diff options
Diffstat (limited to 'src/tests/disable_function/disabled_functions_called_file_r.phpt')
| -rw-r--r-- | src/tests/disable_function/disabled_functions_called_file_r.phpt | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/src/tests/disable_function/disabled_functions_called_file_r.phpt b/src/tests/disable_function/disabled_functions_called_file_r.phpt new file mode 100644 index 0000000..b361dc8 --- /dev/null +++ b/src/tests/disable_function/disabled_functions_called_file_r.phpt | |||
| @@ -0,0 +1,34 @@ | |||
| 1 | --TEST-- | ||
| 2 | Disable functions by matching on the filename_r where the function is called, and not defined | ||
| 3 | --SKIPIF-- | ||
| 4 | <?php if (!extension_loaded("snuffleupagus")) die "skip"; ?> | ||
| 5 | --INI-- | ||
| 6 | sp.configuration_file={PWD}/config/config_disabled_functions_called_file_r.ini | ||
| 7 | --FILE-- | ||
| 8 | <?php | ||
| 9 | $dir = __DIR__; | ||
| 10 | |||
| 11 | @unlink("$dir/myfunc.php"); | ||
| 12 | |||
| 13 | $mycode = <<< EOD | ||
| 14 | <?php | ||
| 15 | function test() { | ||
| 16 | echo "TOTO"; | ||
| 17 | } | ||
| 18 | ?> | ||
| 19 | EOD; | ||
| 20 | |||
| 21 | file_put_contents("$dir/myfunc.php", $mycode); | ||
| 22 | |||
| 23 | include "$dir/myfunc.php"; | ||
| 24 | |||
| 25 | test(); | ||
| 26 | |||
| 27 | ?> | ||
| 28 | --CLEAN-- | ||
| 29 | <?php | ||
| 30 | $dir = __DIR__; | ||
| 31 | @unlink("$dir/myfunc.php"); | ||
| 32 | ?> | ||
| 33 | --EXPECTF-- | ||
| 34 | Fatal error: [snuffleupagus][disabled_function] Aborted execution on call of the function 'test' in %a/myfunc.php on line 3 | ||
