diff options
Diffstat (limited to 'src/tests/disable_function/disabled_functions_callback_called_file_r.phpt')
| -rw-r--r-- | src/tests/disable_function/disabled_functions_callback_called_file_r.phpt | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/src/tests/disable_function/disabled_functions_callback_called_file_r.phpt b/src/tests/disable_function/disabled_functions_callback_called_file_r.phpt new file mode 100644 index 0000000..9c25f9d --- /dev/null +++ b/src/tests/disable_function/disabled_functions_callback_called_file_r.phpt | |||
| @@ -0,0 +1,39 @@ | |||
| 1 | --TEST-- | ||
| 2 | Disable functions by matching on the filename_r where the callback 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_callback_called_file_r.ini | ||
| 7 | --FILE-- | ||
| 8 | <?php | ||
| 9 | $dir = __DIR__; | ||
| 10 | |||
| 11 | @unlink("$dir/myfunc_callback.php"); | ||
| 12 | |||
| 13 | $mycode = <<< 'EOD' | ||
| 14 | <?php | ||
| 15 | |||
| 16 | function test_callback() { | ||
| 17 | return "Test_callback"; | ||
| 18 | } | ||
| 19 | |||
| 20 | function test(callable $toto) { | ||
| 21 | return $toto(); | ||
| 22 | } | ||
| 23 | ?> | ||
| 24 | EOD; | ||
| 25 | |||
| 26 | file_put_contents("$dir/myfunc_callback.php", $mycode); | ||
| 27 | |||
| 28 | include "$dir/myfunc_callback.php"; | ||
| 29 | |||
| 30 | echo test('test_callback'); | ||
| 31 | |||
| 32 | ?> | ||
| 33 | --CLEAN-- | ||
| 34 | <?php | ||
| 35 | $dir = __DIR__; | ||
| 36 | @unlink("$dir/myfunc_callback.php"); | ||
| 37 | ?> | ||
| 38 | --EXPECTF-- | ||
| 39 | Fatal error: [snuffleupagus][disabled_function] Aborted execution on call of the function 'test_callback' in %a/myfunc_callback.php on line 4 | ||
