diff options
| author | jvoisin | 2021-05-08 16:45:07 +0200 |
|---|---|---|
| committer | jvoisin | 2021-05-08 16:45:07 +0200 |
| commit | ad623f1d78151dfe2eaee85e93ed1058be1c7f91 (patch) | |
| tree | 33aba1f387468054074eb8d51e8a19debfeb4128 /src/tests/disable_function | |
| parent | db14b8549e7bb9c132435f845a16f8d33677e865 (diff) | |
Add a test for #390
Diffstat (limited to 'src/tests/disable_function')
| -rw-r--r-- | src/tests/disable_function/config/disabled_functions.ini | 1 | ||||
| -rw-r--r-- | src/tests/disable_function/disabled_functions_shell_exec_wrong.phpt | 14 |
2 files changed, 15 insertions, 0 deletions
diff --git a/src/tests/disable_function/config/disabled_functions.ini b/src/tests/disable_function/config/disabled_functions.ini index df7013f..0758c98 100644 --- a/src/tests/disable_function/config/disabled_functions.ini +++ b/src/tests/disable_function/config/disabled_functions.ini | |||
| @@ -7,3 +7,4 @@ sp.disable_function.function_r("^var_dump$").drop(); | |||
| 7 | sp.disable_function.function("sprintf").filename("/wrong file name").drop(); | 7 | sp.disable_function.function("sprintf").filename("/wrong file name").drop(); |
| 8 | sp.disable_function.function("sprintf").filename("/wrong file name").drop(); | 8 | sp.disable_function.function("sprintf").filename("/wrong file name").drop(); |
| 9 | sp.disable_function.function("eval").drop(); | 9 | sp.disable_function.function("eval").drop(); |
| 10 | sp.disable_function.function("shell_exec").param("foo").value("bar").drop(); | ||
diff --git a/src/tests/disable_function/disabled_functions_shell_exec_wrong.phpt b/src/tests/disable_function/disabled_functions_shell_exec_wrong.phpt new file mode 100644 index 0000000..580679c --- /dev/null +++ b/src/tests/disable_function/disabled_functions_shell_exec_wrong.phpt | |||
| @@ -0,0 +1,14 @@ | |||
| 1 | --TEST-- | ||
| 2 | Disable functions - shell_exec, with a non-existing command | ||
| 3 | --SKIPIF-- | ||
| 4 | <?php if (!extension_loaded("snuffleupagus")) print "skip"; ?> | ||
| 5 | --INI-- | ||
| 6 | sp.configuration_file={PWD}/config/disabled_functions.ini | ||
| 7 | --FILE-- | ||
| 8 | <?php | ||
| 9 | $gs = exec( 'foo' ); | ||
| 10 | echo "YES"; | ||
| 11 | ?> | ||
| 12 | --EXPECTF-- | ||
| 13 | %sfoo: not found | ||
| 14 | YES | ||
