diff options
| author | jvoisin | 2017-11-06 23:11:06 +0100 |
|---|---|---|
| committer | jvoisin | 2017-11-06 23:11:06 +0100 |
| commit | e6b7258081bab6589429d5b49736bbd33ad5e5f6 (patch) | |
| tree | 6278be9730bd920958ab1411e639e504ee39a063 | |
| parent | 8070f622122344ae52b55c3f80e43a1733ae59e2 (diff) | |
Add a failing test
| -rw-r--r-- | src/tests/config/disabled_functions_ret_type_object.ini | 1 | ||||
| -rw-r--r-- | src/tests/disabled_functions_ret_type_object.phpt | 17 |
2 files changed, 18 insertions, 0 deletions
diff --git a/src/tests/config/disabled_functions_ret_type_object.ini b/src/tests/config/disabled_functions_ret_type_object.ini new file mode 100644 index 0000000..8fe240b --- /dev/null +++ b/src/tests/config/disabled_functions_ret_type_object.ini | |||
| @@ -0,0 +1 @@ | |||
| sp.disable_function.function("a").ret_type("object").drop(); | |||
diff --git a/src/tests/disabled_functions_ret_type_object.phpt b/src/tests/disabled_functions_ret_type_object.phpt new file mode 100644 index 0000000..66f298c --- /dev/null +++ b/src/tests/disabled_functions_ret_type_object.phpt | |||
| @@ -0,0 +1,17 @@ | |||
| 1 | --TEST-- | ||
| 2 | Disable functions check on `ret` by type matching (object). | ||
| 3 | --SKIPIF-- | ||
| 4 | <?php if (!extension_loaded("snuffleupagus")) die "skip"; ?> | ||
| 5 | --INI-- | ||
| 6 | sp.configuration_file={PWD}/config/disabled_functions_ret_type_object.ini | ||
| 7 | --XFAIL-- | ||
| 8 | We're not implementing hooking on retval of user functions yet | ||
| 9 | --FILE-- | ||
| 10 | <?php | ||
| 11 | function a(){ | ||
| 12 | return new StdClass(); | ||
| 13 | } | ||
| 14 | $var = a(); | ||
| 15 | echo "fail"; | ||
| 16 | ?> | ||
| 17 | --EXPECTF-- | ||
