diff options
| author | xXx-caillou-xXx | 2018-07-13 14:47:49 +0200 |
|---|---|---|
| committer | jvoisin | 2018-07-13 12:47:49 +0000 |
| commit | b1bf270b41f94ce2df668be611e5b646397a7a52 (patch) | |
| tree | 8b661feaecb1914c38ac572e51a2b7bedd13b81d /src/tests | |
| parent | e8e5314f44dbbbaf5e421aaad88408ff20c5a248 (diff) | |
Fix hooking on `print`
Diffstat (limited to 'src/tests')
| -rw-r--r-- | src/tests/config/disabled_function_print.ini | 1 | ||||
| -rw-r--r-- | src/tests/disabled_function_print.phpt | 18 |
2 files changed, 19 insertions, 0 deletions
diff --git a/src/tests/config/disabled_function_print.ini b/src/tests/config/disabled_function_print.ini new file mode 100644 index 0000000..22d957f --- /dev/null +++ b/src/tests/config/disabled_function_print.ini | |||
| @@ -0,0 +1 @@ | |||
| sp.disable_function.function("print").value("oops").drop(); | |||
diff --git a/src/tests/disabled_function_print.phpt b/src/tests/disabled_function_print.phpt new file mode 100644 index 0000000..fc05360 --- /dev/null +++ b/src/tests/disabled_function_print.phpt | |||
| @@ -0,0 +1,18 @@ | |||
| 1 | --TEST-- | ||
| 2 | Echo hooking | ||
| 3 | --SKIPIF-- | ||
| 4 | <?php if (!extension_loaded("snuffleupagus")) die "skip"; ?> | ||
| 5 | --INI-- | ||
| 6 | sp.configuration_file={PWD}/config/disabled_function_print.ini | ||
| 7 | --FILE-- | ||
| 8 | <?php | ||
| 9 | function test($a) { | ||
| 10 | print "$a"; | ||
| 11 | } | ||
| 12 | print "qwe"; | ||
| 13 | test("rty"); | ||
| 14 | test("oops"); | ||
| 15 | ?> | ||
| 16 | --CLEAN-- | ||
| 17 | --EXPECTF-- | ||
| 18 | qwerty[snuffleupagus][0.0.0.0][disabled_function][drop] Aborted execution on call of the function 'echo' in %a/tests/disabled_function_print.php:3. | ||
