summaryrefslogtreecommitdiff
path: root/src/tests
diff options
context:
space:
mode:
authorjvoisin2020-11-29 19:37:49 +0100
committerGitHub2020-11-29 18:37:49 +0000
commit5be9082f148ab546a0317a28ef5267bb797feb53 (patch)
tree60461e4365ac69434a5529c6efa10faefc63f39f /src/tests
parent83b631a183c1df4233438459cb3386b715e4f2b3 (diff)
Make the `>` operator skip over functions
Diffstat (limited to 'src/tests')
-rw-r--r--src/tests/disable_function/config/config_disabled_functions_chain_call_skip.ini1
-rw-r--r--src/tests/disable_function/disabled_functions_chain_call_skip.phpt29
2 files changed, 30 insertions, 0 deletions
diff --git a/src/tests/disable_function/config/config_disabled_functions_chain_call_skip.ini b/src/tests/disable_function/config/config_disabled_functions_chain_call_skip.ini
new file mode 100644
index 0000000..4d2f68d
--- /dev/null
+++ b/src/tests/disable_function/config/config_disabled_functions_chain_call_skip.ini
@@ -0,0 +1 @@
sp.disable_function.function("a>c").simulation().drop();
diff --git a/src/tests/disable_function/disabled_functions_chain_call_skip.phpt b/src/tests/disable_function/disabled_functions_chain_call_skip.phpt
new file mode 100644
index 0000000..9ff84b9
--- /dev/null
+++ b/src/tests/disable_function/disabled_functions_chain_call_skip.phpt
@@ -0,0 +1,29 @@
1--TEST--
2Disable functions by matching the calltrace, with a superfluous function in between
3--SKIPIF--
4<?php if (!extension_loaded("snuffleupagus")) die "skip"; ?>
5--INI--
6sp.configuration_file={PWD}/config/config_disabled_functions_chain_call_skip.ini
7--FILE--
8<?php
9
10function a() {
11 echo "I'm in the `a` function!\n";
12 b();
13}
14function b() {
15 echo "I'm in the `b` function!\n";
16 c();
17}
18function c() {
19 echo "I'm in the `c` function!\n";
20}
21
22a();
23?>
24--EXPECTF--
25I'm in the `a` function!
26I'm in the `b` function!
27
28Warning: [snuffleupagus][0.0.0.0][disabled_function][simulation] Aborted execution on call of the function 'a>c' in %s/tests/disable_function/disabled_functions_chain_call_skip.php on line 12
29I'm in the `c` function!