summaryrefslogtreecommitdiff
path: root/src/tests/disable_function/disabled_functions_runtime.phpt
diff options
context:
space:
mode:
Diffstat (limited to 'src/tests/disable_function/disabled_functions_runtime.phpt')
-rw-r--r--src/tests/disable_function/disabled_functions_runtime.phpt32
1 files changed, 32 insertions, 0 deletions
diff --git a/src/tests/disable_function/disabled_functions_runtime.phpt b/src/tests/disable_function/disabled_functions_runtime.phpt
new file mode 100644
index 0000000..4ba1a53
--- /dev/null
+++ b/src/tests/disable_function/disabled_functions_runtime.phpt
@@ -0,0 +1,32 @@
1--TEST--
2Disable functions - runtime inclusion
3--SKIPIF--
4<?php if (!extension_loaded("snuffleupagus")) die "skip"; ?>
5--INI--
6sp.configuration_file={PWD}/config/config_disabled_functions_param_runtime.ini
7--FILE--
8<?php
9
10$dir = __DIR__;
11$content = '<?php function test($param) { echo $param . "\n"; }';
12file_put_contents('file_to_include1.php', $content);
13file_put_contents('file_to_include2.php', $content);
14
15if (rand() % 2) {
16 include "file_to_include1.php";
17} else {
18 include "file_to_include2.php";
19}
20
21test('1338');test('1337');
22
23?>
24--CLEAN--
25<?php
26unlink("file_to_include1.php");
27unlink("file_to_include2.php");
28?>
29--EXPECTF--
301338
31
32Fatal error: [snuffleupagus][disabled_function] Aborted execution on call of the function 'test', because its argument '$param' content (1337) matched a rule in %a/src/file_to_include%d.php on line 1