diff options
| -rw-r--r-- | src/tests/config/disabled_functions_ret_type_array.ini | 1 | ||||
| -rw-r--r-- | src/tests/disabled_functions_ret_type_array.phpt | 12 |
2 files changed, 13 insertions, 0 deletions
diff --git a/src/tests/config/disabled_functions_ret_type_array.ini b/src/tests/config/disabled_functions_ret_type_array.ini new file mode 100644 index 0000000..f72dd82 --- /dev/null +++ b/src/tests/config/disabled_functions_ret_type_array.ini | |||
| @@ -0,0 +1 @@ | |||
| sp.disable_function.function("get_loaded_extensions").drop().alias("Return value is an array").ret_type("array"); | |||
diff --git a/src/tests/disabled_functions_ret_type_array.phpt b/src/tests/disabled_functions_ret_type_array.phpt new file mode 100644 index 0000000..454361d --- /dev/null +++ b/src/tests/disabled_functions_ret_type_array.phpt | |||
| @@ -0,0 +1,12 @@ | |||
| 1 | --TEST-- | ||
| 2 | Disable functions check on `ret` by type matching (array). | ||
| 3 | --SKIPIF-- | ||
| 4 | <?php if (!extension_loaded("snuffleupagus")) die "skip"; ?> | ||
| 5 | --INI-- | ||
| 6 | sp.configuration_file={PWD}/config/disabled_functions_ret_type_array.ini | ||
| 7 | --FILE-- | ||
| 8 | <?php | ||
| 9 | echo get_loaded_extensions(); | ||
| 10 | ?> | ||
| 11 | --EXPECTF-- | ||
| 12 | [snuffleupagus][0.0.0.0][disabled_function][drop] The execution has been aborted in %a/tests/disabled_functions_ret_type_array.php:2, because the function 'get_loaded_extensions' returned 'ARRAY', which matched the rule 'Return value is an array'. | ||
