diff options
Diffstat (limited to 'src/tests/disable_function/disabled_functions_runtime.phpt')
| -rw-r--r-- | src/tests/disable_function/disabled_functions_runtime.phpt | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/src/tests/disable_function/disabled_functions_runtime.phpt b/src/tests/disable_function/disabled_functions_runtime.phpt new file mode 100644 index 0000000..4ba1a53 --- /dev/null +++ b/src/tests/disable_function/disabled_functions_runtime.phpt | |||
| @@ -0,0 +1,32 @@ | |||
| 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 | --CLEAN-- | ||
| 25 | <?php | ||
| 26 | unlink("file_to_include1.php"); | ||
| 27 | unlink("file_to_include2.php"); | ||
| 28 | ?> | ||
| 29 | --EXPECTF-- | ||
| 30 | 1338 | ||
| 31 | |||
| 32 | Fatal error: [snuffleupagus][disabled_function] Aborted execution on call of the function 'test', because its argument '$param' content (1337) matched a rule in %a/src/file_to_include%d.php on line 1 | ||
