diff options
| author | jvoisin | 2017-10-31 18:36:26 +0100 |
|---|---|---|
| committer | jvoisin | 2017-10-31 18:38:19 +0100 |
| commit | a5a2eac3a33a115c9a9aeb4cf843d32c54dac43e (patch) | |
| tree | b183edd6e0ffaee28acaf41a87ac296d25fa61af | |
| parent | edfbc0752d37e27354d0d9565b1697e6fcb4d47d (diff) | |
Add a test to match on array
| -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'. | ||
