diff options
Diffstat (limited to 'src/tests/disabled_functions_param_array.phpt')
| -rw-r--r-- | src/tests/disabled_functions_param_array.phpt | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/src/tests/disabled_functions_param_array.phpt b/src/tests/disabled_functions_param_array.phpt new file mode 100644 index 0000000..6596d1a --- /dev/null +++ b/src/tests/disabled_functions_param_array.phpt | |||
| @@ -0,0 +1,37 @@ | |||
| 1 | --TEST-- | ||
| 2 | Disable functions | ||
| 3 | --SKIPIF-- | ||
| 4 | <?php if (!extension_loaded("snuffleupagus")) die "skip"; ?> | ||
| 5 | --INI-- | ||
| 6 | sp.configuration_file={PWD}/config/config_disabled_functions_param_array.ini | ||
| 7 | --FILE-- | ||
| 8 | <?php | ||
| 9 | function foo($arr) { | ||
| 10 | echo $arr["a"]."\n"; | ||
| 11 | } | ||
| 12 | $a=Array("a"=>"test1"); | ||
| 13 | foo($a); | ||
| 14 | $a=Array("a"=>"abcd"); | ||
| 15 | foo($a); | ||
| 16 | $a=Array("a"=>"abcde"); | ||
| 17 | foo($a); | ||
| 18 | $a=Array("bla"=>"abcdef"); | ||
| 19 | foo($a); | ||
| 20 | $a=Array("bla"=>"aaa", "a"=>"eee" ); | ||
| 21 | foo($a); | ||
| 22 | $a=Array("test"=>"aaa", "a"=>"fff" ); | ||
| 23 | foo($a); | ||
| 24 | $a=Array("test2"=>Array("foo"=>Array("lol"=>"bbb")), "a"=>"cccc"); | ||
| 25 | foo($a); | ||
| 26 | $a=Array("test2"=>Array("foo"=>Array("lol"=>"aaa")), "a"=>"dddd"); | ||
| 27 | foo($a); | ||
| 28 | ?> | ||
| 29 | --EXPECTF-- | ||
| 30 | test1 | ||
| 31 | [snuffleupagus][0.0.0.0][disabled_function][drop] The call to the function 'foo' in %a/disabled_functions_param_array.php:3 has been disabled, because its argument 'arr' content (Array) matched the rule '1'. | ||
| 32 | abcde | ||
| 33 | [snuffleupagus][0.0.0.0][disabled_function][drop] The call to the function 'foo' in %a/disabled_functions_param_array.php:3 has been disabled, because its argument 'arr' content (Array) matched the rule '2'. | ||
| 34 | eee | ||
| 35 | [snuffleupagus][0.0.0.0][disabled_function][drop] The call to the function 'foo' in %a/disabled_functions_param_array.php:3 has been disabled, because its argument 'arr' content (Array) matched the rule '3'. | ||
| 36 | cccc | ||
| 37 | [snuffleupagus][0.0.0.0][disabled_function][drop] The call to the function 'foo' in %a/disabled_functions_param_array.php:3 has been disabled, because its argument 'arr' content (Array) matched the rule '4'. | ||
