]> granicus.if.org Git - php/commitdiff
added more exception tests
authorAnatol Belski <ab@php.net>
Tue, 10 Mar 2015 08:09:16 +0000 (09:09 +0100)
committerAnatol Belski <ab@php.net>
Tue, 10 Mar 2015 08:10:25 +0000 (09:10 +0100)
Zend/tests/exception_011.phpt [new file with mode: 0644]
Zend/tests/exception_012.phpt [new file with mode: 0644]

diff --git a/Zend/tests/exception_011.phpt b/Zend/tests/exception_011.phpt
new file mode 100644 (file)
index 0000000..86e1026
--- /dev/null
@@ -0,0 +1,18 @@
+--TEST--
+Test exception doesn't cause RSHUTDOWN bypass, variation 0
+--INI--
+assert.bail=1
+assert.exception=1
+--FILE--
+<?php 
+
+define ("XXXXX", 1);
+assert(false);
+
+?>
+--EXPECTF--
+Fatal error: Uncaught exception 'AssertionException' with message 'assert(false)' in %sexception_011.php:%d
+Stack trace:
+#0 %sexception_011.php(%d): assert(false, 'assert(false)')
+#1 {main}
+  thrown in %sexception_011.php on line %d
diff --git a/Zend/tests/exception_012.phpt b/Zend/tests/exception_012.phpt
new file mode 100644 (file)
index 0000000..91ea84b
--- /dev/null
@@ -0,0 +1,19 @@
+--TEST--
+Test exception doesn't cause RSHUTDOWN bypass, variation 1
+--INI--
+assert.bail=1
+assert.exception=1
+--FILE--
+<?php 
+
+$func = create_function('', 'define("Mommy", 1); assert(false);');
+$func();
+
+?>
+--EXPECTF--
+Fatal error: Uncaught exception 'AssertionException' with message 'assert(false)' in %sexception_012.php(%d) : runtime-created function:%d
+Stack trace:
+#0 %sexception_012.php(%d) : runtime-created function(%d): assert(false, 'assert(false)')
+#1 %sexception_012.php(%d): __lambda_func()
+#2 {main}
+  thrown in %sexception_012.php(%d) : runtime-created function on line %d