diff options
| author | xXx-caillou-xXx | 2017-12-20 18:09:53 +0100 |
|---|---|---|
| committer | jvoisin | 2017-12-20 18:09:53 +0100 |
| commit | e7f541396715ee2895abcf73044b91ae9b746201 (patch) | |
| tree | ba0e9765e7f14f04b92585df1f3fcd1830ab4b00 /src/tests/disabled_function_local_var_10.phpt | |
| parent | 8d6cc4f2b63c3f0dc31fe6cecd34ac023ea1cccb (diff) | |
Better parsing of the rules
Thanks to this huge commit from @xXx-caillou-xXx, we can now write amazingly flexible rules.
Diffstat (limited to 'src/tests/disabled_function_local_var_10.phpt')
| -rw-r--r-- | src/tests/disabled_function_local_var_10.phpt | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/src/tests/disabled_function_local_var_10.phpt b/src/tests/disabled_function_local_var_10.phpt new file mode 100644 index 0000000..538d693 --- /dev/null +++ b/src/tests/disabled_function_local_var_10.phpt | |||
| @@ -0,0 +1,44 @@ | |||
| 1 | --TEST-- | ||
| 2 | Disable functions - match on a local variable | ||
| 3 | --SKIPIF-- | ||
| 4 | <?php if (!extension_loaded("snuffleupagus")) die "skip"; ?> | ||
| 5 | --INI-- | ||
| 6 | sp.configuration_file={PWD}/config/disabled_function_local_var.ini | ||
| 7 | --FILE-- | ||
| 8 | <?php | ||
| 9 | $qwe = Array('123' => Array('qwe'), '456' => Array('no block this')); | ||
| 10 | var_dump($qwe); | ||
| 11 | strlen("qwe"); | ||
| 12 | $qwe = Array('123' => Array('qwe'), '456' => Array(Array('block this'))); | ||
| 13 | var_dump($qwe); | ||
| 14 | strlen("qwe"); | ||
| 15 | ?> | ||
| 16 | --EXPECTF-- | ||
| 17 | array(2) { | ||
| 18 | [123]=> | ||
| 19 | array(1) { | ||
| 20 | [0]=> | ||
| 21 | string(3) "qwe" | ||
| 22 | } | ||
| 23 | [456]=> | ||
| 24 | array(1) { | ||
| 25 | [0]=> | ||
| 26 | string(13) "no block this" | ||
| 27 | } | ||
| 28 | } | ||
| 29 | array(2) { | ||
| 30 | [123]=> | ||
| 31 | array(1) { | ||
| 32 | [0]=> | ||
| 33 | string(3) "qwe" | ||
| 34 | } | ||
| 35 | [456]=> | ||
| 36 | array(1) { | ||
| 37 | [0]=> | ||
| 38 | array(1) { | ||
| 39 | [0]=> | ||
| 40 | string(10) "block this" | ||
| 41 | } | ||
| 42 | } | ||
| 43 | } | ||
| 44 | [snuffleupagus][0.0.0.0][disabled_function][drop] The call to the function 'strlen' in %a/tests/disabled_function_local_var_10.php:%d has been disabled. | ||
