diff options
Diffstat (limited to 'src/tests/disabled_functions_runtime.phpt')
| -rw-r--r-- | src/tests/disabled_functions_runtime.phpt | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/src/tests/disabled_functions_runtime.phpt b/src/tests/disabled_functions_runtime.phpt new file mode 100644 index 0000000..1c6a141 --- /dev/null +++ b/src/tests/disabled_functions_runtime.phpt | |||
| @@ -0,0 +1,31 @@ | |||
| 1 | --TEST-- | ||
| 2 | Disable functions - runtime inclusion | ||
| 3 | --SKIPIF-- | ||
| 4 | <?php if (!extension_loaded("snuffleupagus")) die "skip"; ?> | ||
| 5 | --INI-- | ||
| 6 | sp.configuration_file={PWD}/config/config_disabled_functions_param_runtime.ini | ||
| 7 | --FILE-- | ||
| 8 | <?php | ||
| 9 | |||
| 10 | $dir = __DIR__; | ||
| 11 | $content = '<?php function test($param) { echo $param . "\n"; }'; | ||
| 12 | file_put_contents('file_to_include1.php', $content); | ||
| 13 | file_put_contents('file_to_include2.php', $content); | ||
| 14 | |||
| 15 | if (rand() % 2) { | ||
| 16 | include "file_to_include1.php"; | ||
| 17 | } else { | ||
| 18 | include "file_to_include2.php"; | ||
| 19 | } | ||
| 20 | |||
| 21 | test('1338');test('1337'); | ||
| 22 | |||
| 23 | ?> | ||
| 24 | --EXPECTF-- | ||
| 25 | 1338 | ||
| 26 | [snuffleupagus][0.0.0.0][disabled_function][drop] The call to the function 'test' in %a has been disabled, because its argument 'param' content (1337) matched a rule. | ||
| 27 | --CLEAN-- | ||
| 28 | <?php | ||
| 29 | unlink("file_to_include1.php"); | ||
| 30 | unlink("file_to_include2.php"); | ||
| 31 | ?> | ||
