diff options
| author | jvoisin | 2017-12-28 11:45:14 +0100 |
|---|---|---|
| committer | jvoisin | 2017-12-28 11:45:14 +0100 |
| commit | fe057bba5baaef8fe428b971604194ef9c9119c0 (patch) | |
| tree | 54236db9e61be0bcfc1ffe98fcdb01ce11dc5737 /src | |
| parent | 89432f57aa9769d2efd5b8934241d10b005afd1a (diff) | |
Add two tests to verify that we can hook indirect calls
This should close #104
Diffstat (limited to 'src')
| -rw-r--r-- | src/tests/disabled_native_functions_indirect.phpt | 12 | ||||
| -rw-r--r-- | src/tests/disabled_user_functions_indirect.phpt | 15 |
2 files changed, 27 insertions, 0 deletions
diff --git a/src/tests/disabled_native_functions_indirect.phpt b/src/tests/disabled_native_functions_indirect.phpt new file mode 100644 index 0000000..fc97ee5 --- /dev/null +++ b/src/tests/disabled_native_functions_indirect.phpt | |||
| @@ -0,0 +1,12 @@ | |||
| 1 | --TEST-- | ||
| 2 | Disabled native functions, called indirectly | ||
| 3 | --SKIPIF-- | ||
| 4 | <?php if (!extension_loaded("snuffleupagus")) die "skip"; ?> | ||
| 5 | --INI-- | ||
| 6 | sp.configuration_file={PWD}/config/disabled_functions.ini | ||
| 7 | --FILE-- | ||
| 8 | <?php | ||
| 9 | array_map('system', [1,2,3,4]); | ||
| 10 | ?> | ||
| 11 | --EXPECTF-- | ||
| 12 | [snuffleupagus][0.0.0.0][disabled_function][drop] The call to the function 'system' in%a/tests/disabled_native_functions_indirect.php:2 has been disabled. | ||
diff --git a/src/tests/disabled_user_functions_indirect.phpt b/src/tests/disabled_user_functions_indirect.phpt new file mode 100644 index 0000000..b7c5e19 --- /dev/null +++ b/src/tests/disabled_user_functions_indirect.phpt | |||
| @@ -0,0 +1,15 @@ | |||
| 1 | --TEST-- | ||
| 2 | Disabled user-created functions, called indirectly | ||
| 3 | --SKIPIF-- | ||
| 4 | <?php if (!extension_loaded("snuffleupagus")) die "skip"; ?> | ||
| 5 | --INI-- | ||
| 6 | sp.configuration_file={PWD}/config/config_disabled_user_functions.ini | ||
| 7 | --FILE-- | ||
| 8 | <?php | ||
| 9 | function my_super_function() { | ||
| 10 | echo 1; | ||
| 11 | } | ||
| 12 | array_map('my_super_function', [1,2,3,4]); | ||
| 13 | ?> | ||
| 14 | --EXPECTF-- | ||
| 15 | [snuffleupagus][0.0.0.0][disabled_function][drop] The call to the function 'my_super_function' in %a/tests/disabled_user_functions_indirect.php:3 has been disabled. | ||
