diff options
| author | jvoisin | 2018-02-06 14:14:54 +0100 |
|---|---|---|
| committer | jvoisin | 2018-02-06 14:14:54 +0100 |
| commit | 37e9db2ec911c2f093ee8a69b245c09d43ab0823 (patch) | |
| tree | d0002ff15b2f1ef06b63a6d050b6b9227f9d0a08 /src/tests | |
| parent | 9d153cc185b4e2327a4aabe645cf1fabd3b4f21b (diff) | |
Add a test to check regexps
Diffstat (limited to 'src/tests')
| -rw-r--r-- | src/tests/config/disabled_functions_regexp.ini | 1 | ||||
| -rw-r--r-- | src/tests/disabled_functions_regexp_multiple.phpt | 18 |
2 files changed, 19 insertions, 0 deletions
diff --git a/src/tests/config/disabled_functions_regexp.ini b/src/tests/config/disabled_functions_regexp.ini new file mode 100644 index 0000000..0276039 --- /dev/null +++ b/src/tests/config/disabled_functions_regexp.ini | |||
| @@ -0,0 +1 @@ | |||
| sp.disable_function.function_r("str").drop().simulation(); | |||
diff --git a/src/tests/disabled_functions_regexp_multiple.phpt b/src/tests/disabled_functions_regexp_multiple.phpt new file mode 100644 index 0000000..8f0881f --- /dev/null +++ b/src/tests/disabled_functions_regexp_multiple.phpt | |||
| @@ -0,0 +1,18 @@ | |||
| 1 | --TEST-- | ||
| 2 | Disable functions | ||
| 3 | --SKIPIF-- | ||
| 4 | <?php if (!extension_loaded("snuffleupagus")) die "skip"; ?> | ||
| 5 | --INI-- | ||
| 6 | sp.configuration_file={PWD}/config/disabled_functions_regexp.ini | ||
| 7 | --FILE-- | ||
| 8 | <?php | ||
| 9 | echo strlen("id") . "\n"; | ||
| 10 | echo strcmp("1", "2") . "\n"; | ||
| 11 | print("After") . "\n"; | ||
| 12 | ?> | ||
| 13 | --EXPECTF-- | ||
| 14 | [snuffleupagus][0.0.0.0][disabled_function][simulation] The call to the function 'strlen' in %a/disabled_functions_regexp_multiple.php:2 has been disabled. | ||
| 15 | 2 | ||
| 16 | [snuffleupagus][0.0.0.0][disabled_function][simulation] The call to the function 'strcmp' in %a/disabled_functions_regexp_multiple.php:3 has been disabled. | ||
| 17 | -1 | ||
| 18 | After | ||
