summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/tests/deny_writable/deny_writable_execution_simulation.phpt1
-rw-r--r--src/tests/disable_function/config/config_disabled_functions_name_type_php8.ini1
-rw-r--r--src/tests/disable_function/config/config_disabled_functions_param_str_representation_php8.ini1
-rw-r--r--src/tests/disable_function/disabled_functions_name_type_php8.phpt16
-rw-r--r--src/tests/disable_function/disabled_functions_param_str_representation_php8.phpt25
5 files changed, 43 insertions, 1 deletions
diff --git a/src/tests/deny_writable/deny_writable_execution_simulation.phpt b/src/tests/deny_writable/deny_writable_execution_simulation.phpt
index 1118dc0..e3460e4 100644
--- a/src/tests/deny_writable/deny_writable_execution_simulation.phpt
+++ b/src/tests/deny_writable/deny_writable_execution_simulation.phpt
@@ -1,7 +1,6 @@
1--TEST-- 1--TEST--
2Readonly execution attempt (simulation mode) 2Readonly execution attempt (simulation mode)
3--SKIPIF-- 3--SKIPIF--
4<?php if (PHP_VERSION_ID >= 80000) print "skip"; ?>
5<?php 4<?php
6if (!extension_loaded("snuffleupagus")) { print "skip"; }; 5if (!extension_loaded("snuffleupagus")) { print "skip"; };
7 6
diff --git a/src/tests/disable_function/config/config_disabled_functions_name_type_php8.ini b/src/tests/disable_function/config/config_disabled_functions_name_type_php8.ini
new file mode 100644
index 0000000..0f521e7
--- /dev/null
+++ b/src/tests/disable_function/config/config_disabled_functions_name_type_php8.ini
@@ -0,0 +1 @@
sp.disable_function.function_r("^strcmp$").param("string1").param_type("array").drop();
diff --git a/src/tests/disable_function/config/config_disabled_functions_param_str_representation_php8.ini b/src/tests/disable_function/config/config_disabled_functions_param_str_representation_php8.ini
new file mode 100644
index 0000000..710ddb3
--- /dev/null
+++ b/src/tests/disable_function/config/config_disabled_functions_param_str_representation_php8.ini
@@ -0,0 +1 @@
sp.disable_function.function("var_export").param("value").value("bla").drop();
diff --git a/src/tests/disable_function/disabled_functions_name_type_php8.phpt b/src/tests/disable_function/disabled_functions_name_type_php8.phpt
new file mode 100644
index 0000000..8670b4d
--- /dev/null
+++ b/src/tests/disable_function/disabled_functions_name_type_php8.phpt
@@ -0,0 +1,16 @@
1--TEST--
2Disable functions
3--SKIPIF--
4<?php if (!extension_loaded("snuffleupagus")) print "skip"; ?>
5<?php if (PHP_VERSION_ID < 80000) print "skip"; ?>
6--INI--
7sp.configuration_file={PWD}/config/config_disabled_functions_name_type_php8.ini
8--FILE--
9<?php
10echo strcmp("pouet", "pouet") . "\n";
11echo strcmp([1,23], "pouet") . "\n";
12?>
13--EXPECTF--
140
15
16Fatal error: [snuffleupagus][0.0.0.0][disabled_function][drop] Aborted execution on call of the function 'strcmp', because its argument '$string1' content (?) matched a rule in %s/disabled_functions_name_type_php8.php on line 3
diff --git a/src/tests/disable_function/disabled_functions_param_str_representation_php8.phpt b/src/tests/disable_function/disabled_functions_param_str_representation_php8.phpt
new file mode 100644
index 0000000..c06e612
--- /dev/null
+++ b/src/tests/disable_function/disabled_functions_param_str_representation_php8.phpt
@@ -0,0 +1,25 @@
1--TEST--
2Disable functions - casting various types to string internally in php8
3--SKIPIF--
4<?php if (!extension_loaded("snuffleupagus")) print "skip"; ?>
5--INI--
6sp.configuration_file={PWD}/config/config_disabled_functions_param_str_representation_php8.ini
7--FILE--
8<?php
9echo var_export(true) . "\n";
10echo var_export(false) . "\n";
11echo var_export(null) . "\n";
12echo var_export(1) . "\n";
13echo var_export(1.0) . "\n";
14function f(&$a) {
15 echo var_export($a) . "\n";
16}
17$a = 123; f($a);
18?>
19--EXPECTF--
20true
21false
22NULL
231
241.0
25123