diff options
| author | jvoisin | 2017-12-21 12:03:28 +0100 |
|---|---|---|
| committer | jvoisin | 2017-12-21 12:03:28 +0100 |
| commit | 8a32063601a9a35c4cc888868d4f29ee4931eb8b (patch) | |
| tree | f6fb911ebe0aa80749ffa67fda4b05906cd58255 | |
| parent | b20bbff80ff873fb5ecc3ebc60d72826a8d0ac22 (diff) | |
Add a constant-related test
| -rw-r--r-- | src/tests/config/disabled_function_local_var_const.ini | 1 | ||||
| -rw-r--r-- | src/tests/disabled_function_local_var_const.phpt | 14 |
2 files changed, 15 insertions, 0 deletions
diff --git a/src/tests/config/disabled_function_local_var_const.ini b/src/tests/config/disabled_function_local_var_const.ini new file mode 100644 index 0000000..8450de5 --- /dev/null +++ b/src/tests/config/disabled_function_local_var_const.ini | |||
| @@ -0,0 +1 @@ | |||
| sp.disable_function.function("strlen").var("MY_CONST").value("1337").drop(); | |||
diff --git a/src/tests/disabled_function_local_var_const.phpt b/src/tests/disabled_function_local_var_const.phpt new file mode 100644 index 0000000..4dab437 --- /dev/null +++ b/src/tests/disabled_function_local_var_const.phpt | |||
| @@ -0,0 +1,14 @@ | |||
| 1 | --TEST-- | ||
| 2 | Disable functions - match on a constant | ||
| 3 | --SKIPIF-- | ||
| 4 | <?php if (!extension_loaded("snuffleupagus")) die "skip"; ?> | ||
| 5 | --INI-- | ||
| 6 | sp.configuration_file={PWD}/config/disabled_function_local_var_const.ini | ||
| 7 | --FILE-- | ||
| 8 | <?php | ||
| 9 | $a = 1337; | ||
| 10 | define("MY_CONST", $a); | ||
| 11 | strlen("test"); | ||
| 12 | ?> | ||
| 13 | --EXPECTF-- | ||
| 14 | [snuffleupagus][0.0.0.0][disabled_function][drop] The call to the function 'strlen' in %a/tests/disabled_function_local_var_const.php:4 has been disabled. | ||
