summaryrefslogtreecommitdiff
path: root/src/tests
diff options
context:
space:
mode:
authorjvoisin2022-12-10 12:00:36 +0100
committerjvoisin2022-12-11 18:36:26 +0100
commiteb570f29daa42fd8b90ecfff75382846e51b3a15 (patch)
tree5d14199f0e9f97ec521aa69d2c55f14b21d94db7 /src/tests
parent808e7bff7e17b4f22a64120162734301aa065db0 (diff)
Add support for PHP8.2
Diffstat (limited to 'src/tests')
-rw-r--r--src/tests/deny_writable/deny_writable_execution_disabled.phpt12
-rw-r--r--src/tests/disable_function/disabled_functions_callback_called_file_r.phpt5
-rw-r--r--src/tests/disable_function/disabled_functions_called_file_r.phpt5
-rw-r--r--src/tests/disable_function/disabled_functions_include_once.phpt13
-rw-r--r--src/tests/disable_function/disabled_functions_include_simulation.phpt13
-rw-r--r--src/tests/disable_function/disabled_functions_require.phpt13
-rw-r--r--src/tests/disable_function/disabled_functions_require_allow.phpt11
-rw-r--r--src/tests/disable_function/disabled_functions_require_once.phpt12
-rw-r--r--src/tests/disable_function/disabled_functions_require_simulation.phpt12
-rw-r--r--src/tests/disable_function/disabled_functions_runtime.phpt11
-rw-r--r--src/tests/dump_request/dump_eval_blacklist.phpt9
-rw-r--r--src/tests/dump_request/dump_eval_whitelist.phpt9
-rw-r--r--src/tests/dump_request/dump_request.phpt16
-rw-r--r--src/tests/dump_request/dump_request_stacktrace.phpt9
-rw-r--r--src/tests/dump_request/dump_request_too_big.phpt15
-rw-r--r--src/tests/eval_blacklist/eval_whitelist_include_then_user.phpt10
-rw-r--r--src/tests/stream_wrapper/stream_wrapper_register.phpt1
-rw-r--r--src/tests/stream_wrapper/stream_wrapper_register_php82.phpt28
-rw-r--r--src/tests/xxe/disable_xxe_dom_disabled_php8.phpt10
-rw-r--r--src/tests/xxe/disable_xxe_dom_php8.phpt13
20 files changed, 99 insertions, 128 deletions
diff --git a/src/tests/deny_writable/deny_writable_execution_disabled.phpt b/src/tests/deny_writable/deny_writable_execution_disabled.phpt
index dd01f01..0fd19f4 100644
--- a/src/tests/deny_writable/deny_writable_execution_disabled.phpt
+++ b/src/tests/deny_writable/deny_writable_execution_disabled.phpt
@@ -18,15 +18,13 @@ chmod("$dir/writable_file.txt", 0777);
18chmod("$dir/non_writable_file.txt", 0400); 18chmod("$dir/non_writable_file.txt", 0400);
19include "$dir/writable_file.txt"; 19include "$dir/writable_file.txt";
20include "$dir/non_writable_file.txt"; 20include "$dir/non_writable_file.txt";
21?> 21
22--EXPECT-- 22// Clean up
23Code execution within a writable file.
24Code execution within a non-writable file.
25--CLEAN--
26<?php
27$dir = __DIR__;
28chmod("$dir/non_writable_file.txt", 0777); 23chmod("$dir/non_writable_file.txt", 0777);
29chmod("$dir/writable_file.txt", 0777); 24chmod("$dir/writable_file.txt", 0777);
30unlink("$dir/non_writable_file.txt"); 25unlink("$dir/non_writable_file.txt");
31unlink("$dir/writable_file.txt"); 26unlink("$dir/writable_file.txt");
32?> 27?>
28--EXPECT--
29Code execution within a writable file.
30Code execution within a non-writable file.
diff --git a/src/tests/disable_function/disabled_functions_callback_called_file_r.phpt b/src/tests/disable_function/disabled_functions_callback_called_file_r.phpt
index ec75d74..d977733 100644
--- a/src/tests/disable_function/disabled_functions_callback_called_file_r.phpt
+++ b/src/tests/disable_function/disabled_functions_callback_called_file_r.phpt
@@ -30,10 +30,5 @@ include "$dir/myfunc_callback.php";
30echo test('test_callback'); 30echo test('test_callback');
31 31
32?> 32?>
33--CLEAN--
34<?php
35$dir = __DIR__;
36@unlink("$dir/myfunc_callback.php");
37?>
38--EXPECTF-- 33--EXPECTF--
39Fatal error: [snuffleupagus][0.0.0.0][disabled_function][drop] Aborted execution on call of the function 'test_callback' in %a/myfunc_callback.php on line 4 34Fatal error: [snuffleupagus][0.0.0.0][disabled_function][drop] Aborted execution on call of the function 'test_callback' in %a/myfunc_callback.php on line 4
diff --git a/src/tests/disable_function/disabled_functions_called_file_r.phpt b/src/tests/disable_function/disabled_functions_called_file_r.phpt
index dde26f7..2ba06d4 100644
--- a/src/tests/disable_function/disabled_functions_called_file_r.phpt
+++ b/src/tests/disable_function/disabled_functions_called_file_r.phpt
@@ -25,10 +25,5 @@ include "$dir/myfunc.php";
25test(); 25test();
26 26
27?> 27?>
28--CLEAN--
29<?php
30$dir = __DIR__;
31@unlink("$dir/myfunc.php");
32?>
33--EXPECTF-- 28--EXPECTF--
34Fatal error: [snuffleupagus][0.0.0.0][disabled_function][drop] Aborted execution on call of the function 'test' in %a/myfunc.php on line 3 29Fatal error: [snuffleupagus][0.0.0.0][disabled_function][drop] Aborted execution on call of the function 'test' in %a/myfunc.php on line 3
diff --git a/src/tests/disable_function/disabled_functions_include_once.phpt b/src/tests/disable_function/disabled_functions_include_once.phpt
index 57cb5a1..8b1bec8 100644
--- a/src/tests/disable_function/disabled_functions_include_once.phpt
+++ b/src/tests/disable_function/disabled_functions_include_once.phpt
@@ -7,21 +7,20 @@ sp.configuration_file={PWD}/config/config_disabled_functions_include.ini
7--FILE-- 7--FILE--
8<?php 8<?php
9$dir = __DIR__; 9$dir = __DIR__;
10
11// Just inc ase
12@unlink($dir . '/test.bla');
13@unlink($dir . '/test.sim');
14
10file_put_contents($dir . '/test.bla', "BLA\n"); 15file_put_contents($dir . '/test.bla', "BLA\n");
11file_put_contents($dir . '/test.sim', "MEH\n"); 16file_put_contents($dir . '/test.sim', "MEH\n");
12include_once $dir . '/test.bla'; 17include_once $dir . '/test.bla';
13include_once $dir . '/test.sim'; 18include_once $dir . '/test.sim';
14echo "1337\n"; 19echo "1337\n";
15?> 20?>
16--CLEAN--
17<?php
18$dir = __DIR__;
19unlink($dir . '/test.bla');
20unlink($dir . '/test.sim');
21?>
22--EXPECTF-- 21--EXPECTF--
23BLA 22BLA
24 23
25Warning: [snuffleupagus][0.0.0.0][disabled_function][simulation] Aborted execution on call of the function 'include_once', because its argument 'inclusion path' content (%a/test.sim) matched a rule in %a/disabled_functions_include_once.php on line 6 24Warning: [snuffleupagus][0.0.0.0][disabled_function][simulation] Aborted execution on call of the function 'include_once', because its argument 'inclusion path' content (%a/test.sim) matched a rule in %a/disabled_functions_include_once.php on line %d
26MEH 25MEH
271337 261337
diff --git a/src/tests/disable_function/disabled_functions_include_simulation.phpt b/src/tests/disable_function/disabled_functions_include_simulation.phpt
index 53ea2a4..cf2c693 100644
--- a/src/tests/disable_function/disabled_functions_include_simulation.phpt
+++ b/src/tests/disable_function/disabled_functions_include_simulation.phpt
@@ -7,21 +7,20 @@ sp.configuration_file={PWD}/config/config_disabled_functions_include.ini
7--FILE-- 7--FILE--
8<?php 8<?php
9$dir = __DIR__; 9$dir = __DIR__;
10
11// Just in case
12@unlink($dir . '/test.bla');
13@unlink($dir . '/test.sim');
14
10file_put_contents($dir . '/test.bla', "BLA\n"); 15file_put_contents($dir . '/test.bla', "BLA\n");
11file_put_contents($dir . '/test.sim', "MEH\n"); 16file_put_contents($dir . '/test.sim', "MEH\n");
12include $dir . '/test.bla'; 17include $dir . '/test.bla';
13include $dir . '/test.sim'; 18include $dir . '/test.sim';
14echo "1337\n"; 19echo "1337\n";
15?> 20?>
16--CLEAN--
17<?php
18$dir = __DIR__;
19unlink($dir . '/test.bla');
20unlink($dir . '/test.sim');
21?>
22--EXPECTF-- 21--EXPECTF--
23BLA 22BLA
24 23
25Warning: [snuffleupagus][0.0.0.0][disabled_function][simulation] Aborted execution on call of the function 'include', because its argument 'inclusion path' content (%a/test.sim) matched a rule in %a/disabled_functions_include_simulation.php on line 6 24Warning: [snuffleupagus][0.0.0.0][disabled_function][simulation] Aborted execution on call of the function 'include', because its argument 'inclusion path' content (%a/test.sim) matched a rule in %a/disabled_functions_include_simulation.php on line %d
26MEH 25MEH
271337 261337
diff --git a/src/tests/disable_function/disabled_functions_require.phpt b/src/tests/disable_function/disabled_functions_require.phpt
index df2b2f0..bf59b58 100644
--- a/src/tests/disable_function/disabled_functions_require.phpt
+++ b/src/tests/disable_function/disabled_functions_require.phpt
@@ -7,18 +7,17 @@ sp.configuration_file={PWD}/config/config_disabled_functions_require.ini
7--FILE-- 7--FILE--
8<?php 8<?php
9$dir = __DIR__; 9$dir = __DIR__;
10
11// Just in case
12@unlink($dir . '/test.bla');
13@unlink($dir . '/test.meh');
14
10file_put_contents($dir . '/test.bla', "BLA"); 15file_put_contents($dir . '/test.bla', "BLA");
11file_put_contents($dir . '/test.meh', "MEH"); 16file_put_contents($dir . '/test.meh', "MEH");
12require $dir . '/test.bla'; 17require $dir . '/test.bla';
13require $dir . '/test.meh'; 18require $dir . '/test.meh';
14echo "1337"; 19echo "1337";
15?> 20?>
16--CLEAN--
17<?php
18$dir = __DIR__;
19unlink($dir . '/test.bla');
20unlink($dir . '/test.meh');
21?>
22--EXPECTF-- 21--EXPECTF--
23BLA 22BLA
24Fatal error: [snuffleupagus][0.0.0.0][disabled_function][drop] Aborted execution on call of the function 'require', because its argument 'inclusion path' content (%a/test.meh) matched a rule in %a/disabled_functions_require.php on line 6 23Fatal error: [snuffleupagus][0.0.0.0][disabled_function][drop] Aborted execution on call of the function 'require', because its argument 'inclusion path' content (%a/test.meh) matched a rule in %a/disabled_functions_require.php on line %d
diff --git a/src/tests/disable_function/disabled_functions_require_allow.phpt b/src/tests/disable_function/disabled_functions_require_allow.phpt
index 7ab29aa..37a7e33 100644
--- a/src/tests/disable_function/disabled_functions_require_allow.phpt
+++ b/src/tests/disable_function/disabled_functions_require_allow.phpt
@@ -7,6 +7,11 @@ sp.configuration_file={PWD}/config/config_disabled_functions_require_allow.ini
7--FILE-- 7--FILE--
8<?php 8<?php
9$dir = __DIR__; 9$dir = __DIR__;
10
11// Just in case
12unlink($dir . '/test.bla');
13unlink($dir . '/test.meh');
14
10file_put_contents($dir . '/test.bla', "BLA\n"); 15file_put_contents($dir . '/test.bla', "BLA\n");
11file_put_contents($dir . '/test.meh', "MEH\n"); 16file_put_contents($dir . '/test.meh', "MEH\n");
12require $dir . '/test.bla'; 17require $dir . '/test.bla';
@@ -17,9 +22,3 @@ echo "1337";
17BLA 22BLA
18MEH 23MEH
191337 241337
20--CLEAN--
21<?php
22$dir = __DIR__;
23unlink($dir . '/test.bla');
24unlink($dir . '/test.meh');
25?>
diff --git a/src/tests/disable_function/disabled_functions_require_once.phpt b/src/tests/disable_function/disabled_functions_require_once.phpt
index 7356c08..81049ef 100644
--- a/src/tests/disable_function/disabled_functions_require_once.phpt
+++ b/src/tests/disable_function/disabled_functions_require_once.phpt
@@ -7,18 +7,16 @@ sp.configuration_file={PWD}/config/config_disabled_functions_require.ini
7--FILE-- 7--FILE--
8<?php 8<?php
9$dir = __DIR__; 9$dir = __DIR__;
10// Just in case
11unlink($dir . '/test.bla');
12unlink($dir . '/test.meh');
13
10file_put_contents($dir . '/test.bla', "BLA"); 14file_put_contents($dir . '/test.bla', "BLA");
11file_put_contents($dir . '/test.meh', "MEH"); 15file_put_contents($dir . '/test.meh', "MEH");
12require_once $dir . '/test.bla'; 16require_once $dir . '/test.bla';
13require_once $dir . '/test.meh'; 17require_once $dir . '/test.meh';
14echo "1337"; 18echo "1337";
15?> 19?>
16--CLEAN--
17<?php
18$dir = __DIR__;
19unlink($dir . '/test.bla');
20unlink($dir . '/test.meh');
21?>
22--EXPECTF-- 20--EXPECTF--
23BLA 21BLA
24Fatal error: [snuffleupagus][0.0.0.0][disabled_function][drop] Aborted execution on call of the function 'require_once', because its argument 'inclusion path' content (%a/test.meh) matched a rule in %a/disabled_functions_require_once.php on line 6 22Fatal error: [snuffleupagus][0.0.0.0][disabled_function][drop] Aborted execution on call of the function 'require_once', because its argument 'inclusion path' content (%a/test.meh) matched a rule in %a/disabled_functions_require_once.php on line %d
diff --git a/src/tests/disable_function/disabled_functions_require_simulation.phpt b/src/tests/disable_function/disabled_functions_require_simulation.phpt
index fa1523c..2c52610 100644
--- a/src/tests/disable_function/disabled_functions_require_simulation.phpt
+++ b/src/tests/disable_function/disabled_functions_require_simulation.phpt
@@ -7,21 +7,19 @@ sp.configuration_file={PWD}/config/config_disabled_functions_require.ini
7--FILE-- 7--FILE--
8<?php 8<?php
9$dir = __DIR__; 9$dir = __DIR__;
10// Just in case
11@unlink($dir . '/test.bla');
12@unlink($dir . '/test.sim');
13
10file_put_contents($dir . '/test.bla', "BLA\n"); 14file_put_contents($dir . '/test.bla', "BLA\n");
11file_put_contents($dir . '/test.sim', "MEH\n"); 15file_put_contents($dir . '/test.sim', "MEH\n");
12require $dir . '/test.bla'; 16require $dir . '/test.bla';
13require $dir . '/test.sim'; 17require $dir . '/test.sim';
14echo "1337\n"; 18echo "1337\n";
15?> 19?>
16--CLEAN--
17<?php
18$dir = __DIR__;
19unlink($dir . '/test.bla');
20unlink($dir . '/test.sim');
21?>
22--EXPECTF-- 20--EXPECTF--
23BLA 21BLA
24 22
25Warning: [snuffleupagus][0.0.0.0][disabled_function][simulation] Aborted execution on call of the function 'require', because its argument 'inclusion path' content (%a/test.sim) matched a rule in %a/disabled_functions_require_simulation.php on line 6 23Warning: [snuffleupagus][0.0.0.0][disabled_function][simulation] Aborted execution on call of the function 'require', because its argument 'inclusion path' content (%a/test.sim) matched a rule in %a/disabled_functions_require_simulation.php on line %d
26MEH 24MEH
271337 251337
diff --git a/src/tests/disable_function/disabled_functions_runtime.phpt b/src/tests/disable_function/disabled_functions_runtime.phpt
index 16ecfdb..8175a77 100644
--- a/src/tests/disable_function/disabled_functions_runtime.phpt
+++ b/src/tests/disable_function/disabled_functions_runtime.phpt
@@ -6,8 +6,12 @@ Disable functions - runtime inclusion
6sp.configuration_file={PWD}/config/config_disabled_functions_param_runtime.ini 6sp.configuration_file={PWD}/config/config_disabled_functions_param_runtime.ini
7--FILE-- 7--FILE--
8<?php 8<?php
9
10$dir = __DIR__; 9$dir = __DIR__;
10
11// Just in case
12@unlink("file_to_include1.php");
13@unlink("file_to_include2.php");
14
11$content = '<?php function test($param) { echo $param . "\n"; }'; 15$content = '<?php function test($param) { echo $param . "\n"; }';
12file_put_contents('file_to_include1.php', $content); 16file_put_contents('file_to_include1.php', $content);
13file_put_contents('file_to_include2.php', $content); 17file_put_contents('file_to_include2.php', $content);
@@ -21,11 +25,6 @@ if (rand() % 2) {
21test('1338');test('1337'); 25test('1338');test('1337');
22 26
23?> 27?>
24--CLEAN--
25<?php
26unlink("file_to_include1.php");
27unlink("file_to_include2.php");
28?>
29--EXPECTF-- 28--EXPECTF--
301338 291338
31 30
diff --git a/src/tests/dump_request/dump_eval_blacklist.phpt b/src/tests/dump_request/dump_eval_blacklist.phpt
index e294703..ae6ffc0 100644
--- a/src/tests/dump_request/dump_eval_blacklist.phpt
+++ b/src/tests/dump_request/dump_eval_blacklist.phpt
@@ -4,15 +4,6 @@ Dump eval blacklist
4<?php 4<?php
5if (!extension_loaded("snuffleupagus")) print "skip"; 5if (!extension_loaded("snuffleupagus")) print "skip";
6?> 6?>
7--CLEAN--
8<?php
9if (is_dir("/tmp/dump_result/")) {
10 foreach (glob("/tmp/dump_result/sp_dump.*") as $dump) {
11 @unlink($dump);
12 }
13 @rmdir("/tmp/dump_result/");
14}
15?>
16--POST-- 7--POST--
17post_a=data_post_a&post_b=data_post_b 8post_a=data_post_a&post_b=data_post_b
18--GET-- 9--GET--
diff --git a/src/tests/dump_request/dump_eval_whitelist.phpt b/src/tests/dump_request/dump_eval_whitelist.phpt
index 7385146..09f5523 100644
--- a/src/tests/dump_request/dump_eval_whitelist.phpt
+++ b/src/tests/dump_request/dump_eval_whitelist.phpt
@@ -4,15 +4,6 @@ Dump eval whitelist
4<?php 4<?php
5if (!extension_loaded("snuffleupagus")) print "skip"; 5if (!extension_loaded("snuffleupagus")) print "skip";
6?> 6?>
7--CLEAN--
8<?php
9if (is_dir("/tmp/dump_result/")) {
10 foreach (glob("/tmp/dump_result/sp_dump.*") as $dump) {
11 @unlink($dump);
12 }
13 @rmdir("/tmp/dump_result/");
14}
15?>
16--POST-- 7--POST--
17post_a=data_post_a&post_b=data_post_b 8post_a=data_post_a&post_b=data_post_b
18--GET-- 9--GET--
diff --git a/src/tests/dump_request/dump_request.phpt b/src/tests/dump_request/dump_request.phpt
index e955776..7ad0323 100644
--- a/src/tests/dump_request/dump_request.phpt
+++ b/src/tests/dump_request/dump_request.phpt
@@ -6,15 +6,6 @@ if (!extension_loaded("snuffleupagus")) {
6 print "skip"; 6 print "skip";
7} 7}
8?> 8?>
9--CLEAN--
10<?php
11if (is_dir("/tmp/dump_result/")) {
12 foreach (glob("/tmp/dump_result/sp_dump.*") as $dump) {
13 @unlink($dump);
14 }
15 @rmdir("/tmp/dump_result/");
16}
17?>
18--POST-- 9--POST--
19post_a=data_post_a&post_b=data_post_b 10post_a=data_post_a&post_b=data_post_b
20--GET-- 11--GET--
@@ -25,6 +16,13 @@ cookie_a=data_cookie_a&cookie_b=data_cookie_b
25sp.configuration_file={PWD}/config/dump_request.ini 16sp.configuration_file={PWD}/config/dump_request.ini
26--FILE-- 17--FILE--
27<?php 18<?php
19// Just in case
20if (is_dir("/tmp/dump_result/")) {
21 foreach (glob("/tmp/dump_result/sp_dump.*") as $dump) {
22 @unlink($dump);
23 }
24 @rmdir("/tmp/dump_result/");
25}
28echo "1\n"; 26echo "1\n";
29system("echo 1337;"); 27system("echo 1337;");
30$filename = glob('/tmp/dump_result/sp_dump.*')[0]; 28$filename = glob('/tmp/dump_result/sp_dump.*')[0];
diff --git a/src/tests/dump_request/dump_request_stacktrace.phpt b/src/tests/dump_request/dump_request_stacktrace.phpt
index 9f85044..765e912 100644
--- a/src/tests/dump_request/dump_request_stacktrace.phpt
+++ b/src/tests/dump_request/dump_request_stacktrace.phpt
@@ -6,15 +6,6 @@ if (!extension_loaded("snuffleupagus")) {
6 print "skip"; 6 print "skip";
7} 7}
8?> 8?>
9--CLEAN--
10<?php
11if (is_dir("/tmp/dump_result/")) {
12 foreach (glob("/tmp/dump_result/sp_dump.*") as $dump) {
13 @unlink($dump);
14 }
15 @rmdir("/tmp/dump_result/");
16}
17?>
18--POST-- 9--POST--
19post_a=data_post_a&post_b=data_post_b 10post_a=data_post_a&post_b=data_post_b
20--GET-- 11--GET--
diff --git a/src/tests/dump_request/dump_request_too_big.phpt b/src/tests/dump_request/dump_request_too_big.phpt
index 4fc8f81..b143bd0 100644
--- a/src/tests/dump_request/dump_request_too_big.phpt
+++ b/src/tests/dump_request/dump_request_too_big.phpt
@@ -6,15 +6,6 @@ if (!extension_loaded("snuffleupagus")) {
6 print "skip"; 6 print "skip";
7} 7}
8?> 8?>
9--CLEAN--
10<?php
11if (is_dir("/tmp/dump_result/")) {
12 foreach (glob("/tmp/dump_result/sp_dump.*") as $dump) {
13 @unlink($dump);
14 }
15 @rmdir("/tmp/dump_result/");
16}
17?>
18--POST-- 9--POST--
19post_a=data_post_a&post_b=data_post_b&post_c=c 10post_a=data_post_a&post_b=data_post_b&post_c=c
20--GET-- 11--GET--
@@ -29,6 +20,12 @@ END;
29sp.configuration_file={PWD}/config/dump_request.ini 20sp.configuration_file={PWD}/config/dump_request.ini
30--FILE-- 21--FILE--
31<?php 22<?php
23if (is_dir("/tmp/dump_result/")) {
24 foreach (glob("/tmp/dump_result/sp_dump.*") as $dump) {
25 @unlink($dump);
26 }
27 @rmdir("/tmp/dump_result/");
28}
32echo "1\n"; 29echo "1\n";
33system("echo 1337;"); 30system("echo 1337;");
34$filename = glob('/tmp/dump_result/*')[0]; 31$filename = glob('/tmp/dump_result/*')[0];
diff --git a/src/tests/eval_blacklist/eval_whitelist_include_then_user.phpt b/src/tests/eval_blacklist/eval_whitelist_include_then_user.phpt
index 825480f..e456ff9 100644
--- a/src/tests/eval_blacklist/eval_whitelist_include_then_user.phpt
+++ b/src/tests/eval_blacklist/eval_whitelist_include_then_user.phpt
@@ -9,6 +9,9 @@ sp.configuration_file={PWD}/config/eval_whitelist.ini
9$b = 1337; 9$b = 1337;
10$dir = __DIR__; 10$dir = __DIR__;
11 11
12// Just in case
13@unlink($dir . '/test.bla');
14
12file_put_contents($dir . '/test.bla', '<?php $b = sin(1) ?>'); 15file_put_contents($dir . '/test.bla', '<?php $b = sin(1) ?>');
13 16
14$a = cos(1); 17$a = cos(1);
@@ -18,13 +21,8 @@ echo "After allowed eval: $a\n";
18eval("include_once('$dir' . '/test.bla');"); 21eval("include_once('$dir' . '/test.bla');");
19echo "After eval: $b\n"; 22echo "After eval: $b\n";
20?> 23?>
21--CLEAN--
22<?php
23$dir = __DIR__;
24unlink($dir . '/test.bla');
25?>
26--EXPECTF-- 24--EXPECTF--
27Outside of eval: 0.54030230586814 25Outside of eval: 0.54030230586814
28After allowed eval: 0.28366218546323 26After allowed eval: 0.28366218546323
29 27
30Fatal error: [snuffleupagus][0.0.0.0][Eval_whitelist][drop] The function 'sin' isn't in the eval whitelist, dropping its call. in %a/test.bla on line 1 \ No newline at end of file 28Fatal error: [snuffleupagus][0.0.0.0][Eval_whitelist][drop] The function 'sin' isn't in the eval whitelist, dropping its call. in %a/test.bla on line 1
diff --git a/src/tests/stream_wrapper/stream_wrapper_register.phpt b/src/tests/stream_wrapper/stream_wrapper_register.phpt
index 27d8afb..4fa9ea8 100644
--- a/src/tests/stream_wrapper/stream_wrapper_register.phpt
+++ b/src/tests/stream_wrapper/stream_wrapper_register.phpt
@@ -2,6 +2,7 @@
2Stream wrapper 2Stream wrapper
3--SKIPIF-- 3--SKIPIF--
4<?php if (!extension_loaded("snuffleupagus")) print "skip"; ?> 4<?php if (!extension_loaded("snuffleupagus")) print "skip"; ?>
5<?php if (PHP_VERSION_ID >= 80200) print "skip"; ?>
5--INI-- 6--INI--
6sp.configuration_file={PWD}/config/config_stream_wrapper_register.ini 7sp.configuration_file={PWD}/config/config_stream_wrapper_register.ini
7--FILE-- 8--FILE--
diff --git a/src/tests/stream_wrapper/stream_wrapper_register_php82.phpt b/src/tests/stream_wrapper/stream_wrapper_register_php82.phpt
new file mode 100644
index 0000000..b03a2f1
--- /dev/null
+++ b/src/tests/stream_wrapper/stream_wrapper_register_php82.phpt
@@ -0,0 +1,28 @@
1--TEST--
2Stream wrapper on PHP8.2+
3--SKIPIF--
4<?php if (!extension_loaded("snuffleupagus")) print "skip"; ?>
5<?php if (PHP_VERSION_ID < 80200) print "skip"; ?>
6--INI--
7sp.configuration_file={PWD}/config/config_stream_wrapper_register.ini
8--FILE--
9<?php
10class qwe {
11 function stream_open($fname) {
12 return $fname;
13 }
14}
15
16stream_wrapper_register("lelel", "qwe");
17stream_wrapper_register("lolol", "qwe");
18fopen("lelel://asdasd", "r");
19fopen("lolol://asdasd", "r");
20?>
21--EXPECTF--
22Deprecated: Creation of dynamic property qwe::$context is deprecated in %s/tests/stream_wrapper/stream_wrapper_register_php82.php on line %d
23
24Warning: fopen(): Unable to find the wrapper "lolol" - did you forget to enable it when you configured PHP? in %a/stream_wrapper_register_php82.php on line %d
25
26Warning: fopen(): file:// wrapper is disabled in the server configuration in %a/stream_wrapper_register_php82.php on line %d
27
28Warning: fopen(lolol://asdasd): %s to open stream: no suitable wrapper could be found in %a/stream_wrapper_register_php82.php on line %d
diff --git a/src/tests/xxe/disable_xxe_dom_disabled_php8.phpt b/src/tests/xxe/disable_xxe_dom_disabled_php8.phpt
index 01e3349..a78fe2d 100644
--- a/src/tests/xxe/disable_xxe_dom_disabled_php8.phpt
+++ b/src/tests/xxe/disable_xxe_dom_disabled_php8.phpt
@@ -10,6 +10,10 @@ dom
10--FILE-- 10--FILE--
11<?php 11<?php
12$dir = __DIR__; 12$dir = __DIR__;
13// Just in case
14@unlink($dir . "/content.xml");
15@unlink($dir . "/content.txt");
16
13$content = '<content>WARNING, external entity loaded!</content>'; 17$content = '<content>WARNING, external entity loaded!</content>';
14file_put_contents($dir . '/content.txt', $content); 18file_put_contents($dir . '/content.txt', $content);
15 19
@@ -49,9 +53,3 @@ default setting with LIBXML_NOENT: WARNING, external entity loaded!
49default setting without LIBXML_NOENT: 53default setting without LIBXML_NOENT:
50disabled entity loader with LIBXML_NOENT: WARNING, external entity loaded! 54disabled entity loader with LIBXML_NOENT: WARNING, external entity loaded!
51disabled entity loader without LIBXML_NOENT: 55disabled entity loader without LIBXML_NOENT:
52--CLEAN--
53<?php
54$dir = __DIR__;
55unlink($dir . "/content.xml");
56unlink($dir . "/content.txt");
57?>
diff --git a/src/tests/xxe/disable_xxe_dom_php8.phpt b/src/tests/xxe/disable_xxe_dom_php8.phpt
index 485828f..133f87e 100644
--- a/src/tests/xxe/disable_xxe_dom_php8.phpt
+++ b/src/tests/xxe/disable_xxe_dom_php8.phpt
@@ -10,6 +10,11 @@ dom
10--FILE-- 10--FILE--
11<?php 11<?php
12$dir = __DIR__; 12$dir = __DIR__;
13
14// Just in case
15@unlink($dir . "/content.xml");
16@unlink($dir . "/content.txt");
17
13$content = '<content>WARNING, external entity loaded!</content>'; 18$content = '<content>WARNING, external entity loaded!</content>';
14file_put_contents($dir . '/content.txt', $content); 19file_put_contents($dir . '/content.txt', $content);
15 20
@@ -48,12 +53,6 @@ printf("disabled entity loader without LIBXML_NOENT: %s\n", $dom->getElementsByT
48default setting with LIBXML_NOENT: WARNING, external entity loaded! 53default setting with LIBXML_NOENT: WARNING, external entity loaded!
49default setting without LIBXML_NOENT: 54default setting without LIBXML_NOENT:
50 55
51Warning: [snuffleupagus][0.0.0.0][xxe][log] A call to libxml_set_external_entity_loader was tried and nopped in %a.php on line 26 56Warning: [snuffleupagus][0.0.0.0][xxe][log] A call to libxml_set_external_entity_loader was tried and nopped in %a.php on line %d
52disabled entity loader with LIBXML_NOENT: WARNING, external entity loaded! 57disabled entity loader with LIBXML_NOENT: WARNING, external entity loaded!
53disabled entity loader without LIBXML_NOENT: 58disabled entity loader without LIBXML_NOENT:
54--CLEAN--
55<?php
56$dir = __DIR__;
57unlink($dir . "/content.xml");
58unlink($dir . "/content.txt");
59?>