summaryrefslogtreecommitdiff
path: root/src/tests/disabled_functions_param.phpt
diff options
context:
space:
mode:
Diffstat (limited to 'src/tests/disabled_functions_param.phpt')
-rw-r--r--src/tests/disabled_functions_param.phpt24
1 files changed, 24 insertions, 0 deletions
diff --git a/src/tests/disabled_functions_param.phpt b/src/tests/disabled_functions_param.phpt
new file mode 100644
index 0000000..2309217
--- /dev/null
+++ b/src/tests/disabled_functions_param.phpt
@@ -0,0 +1,24 @@
1--TEST--
2Disable functions
3--SKIPIF--
4<?php if (!extension_loaded("snuffleupagus")) die "skip"; ?>
5--INI--
6sp.configuration_file={PWD}/config/config_disabled_functions_param.ini
7--FILE--
8<?php
9system("id");
10system("echo win");
11var_dump(array_sum([1,2,3,4,5]));
12shell_exec("id");
13echo shell_exec("echo 42");
14strcmp("bla", "ble");
15strncmp("bla", "ble", 2);
16?>
17--EXPECTF--
18[snuffleupagus][0.0.0.0][disabled_function][drop] The call to the function 'system' in %a/disabled_functions_param.php:2 has been disabled, because its argument 'command' content (id) matched the rule '1'.
19win
20int(15)
21[snuffleupagus][0.0.0.0][disabled_function][drop] The call to the function 'shell_exec' in %a/disabled_functions_param.php:5 has been disabled, because its argument 'cmd' content (id) matched the rule '3'.
2242
23[snuffleupagus][0.0.0.0][disabled_function][notice] The call to the function 'strcmp' in %a/tests/disabled_functions_param.php:7 has been disabled, because its argument 'str1' content (bla) matched the rule '5'.
24[snuffleupagus][0.0.0.0][disabled_function][notice] The call to the function 'strncmp' in %a/tests/disabled_functions_param.php:8 has been disabled, because its argument 'str1' content (bla) matched a rule.