diff options
Diffstat (limited to 'src')
4 files changed, 33 insertions, 0 deletions
diff --git a/src/tests/strict_mode/config/config_strict_mode_disabled.ini b/src/tests/strict_mode/config/config_strict_mode_disabled.ini new file mode 100644 index 0000000..2e68471 --- /dev/null +++ b/src/tests/strict_mode/config/config_strict_mode_disabled.ini | |||
| @@ -0,0 +1 @@ | |||
| sp.global_strict.disable(); | |||
diff --git a/src/tests/strict_mode/config/config_strict_mode_enabled.ini b/src/tests/strict_mode/config/config_strict_mode_enabled.ini new file mode 100644 index 0000000..2dc11fc --- /dev/null +++ b/src/tests/strict_mode/config/config_strict_mode_enabled.ini | |||
| @@ -0,0 +1 @@ | |||
| sp.global_strict.enable(); | |||
diff --git a/src/tests/strict_mode/strict_mode_disabled.phpt b/src/tests/strict_mode/strict_mode_disabled.phpt new file mode 100644 index 0000000..105f43c --- /dev/null +++ b/src/tests/strict_mode/strict_mode_disabled.phpt | |||
| @@ -0,0 +1,13 @@ | |||
| 1 | --TEST-- | ||
| 2 | Strict mode disabled | ||
| 3 | --SKIPIF-- | ||
| 4 | <?php | ||
| 5 | if (!extension_loaded("snuffleupagus")) print "skip snuffleupagus extension missing"; | ||
| 6 | ?> | ||
| 7 | --INI-- | ||
| 8 | sp.configuration_file={PWD}/config/config_strict_mode_disabled.ini | ||
| 9 | --FILE-- | ||
| 10 | <?php | ||
| 11 | ini_set('display_errors', 1); | ||
| 12 | ?> | ||
| 13 | --EXPECTF-- | ||
diff --git a/src/tests/strict_mode/strict_mode_enabled.phpt b/src/tests/strict_mode/strict_mode_enabled.phpt new file mode 100644 index 0000000..c511f9a --- /dev/null +++ b/src/tests/strict_mode/strict_mode_enabled.phpt | |||
| @@ -0,0 +1,18 @@ | |||
| 1 | --TEST-- | ||
| 2 | Strict mode enabled | ||
| 3 | --SKIPIF-- | ||
| 4 | <?php | ||
| 5 | if (!extension_loaded("snuffleupagus")) print "skip snuffleupagus extension missing"; | ||
| 6 | ?> | ||
| 7 | --INI-- | ||
| 8 | sp.configuration_file={PWD}/config/config_strict_mode_enabled.ini | ||
| 9 | --FILE-- | ||
| 10 | <?php | ||
| 11 | ini_set('display_errors', 1); | ||
| 12 | ?> | ||
| 13 | --EXPECTF-- | ||
| 14 | Fatal error: Uncaught TypeError: ini_set() expects parameter 2 to be string, %s given in %s/tests/strict_mode/strict_mode_enabled.php:%d | ||
| 15 | Stack trace: | ||
| 16 | #0 %s/tests/strict_mode/strict_mode_enabled.php(2): ini_set('display_errors', 1) | ||
| 17 | #1 {main} | ||
| 18 | thrown in %s/tests/strict_mode/strict_mode_enabled.php on line 2 | ||
