]> granicus.if.org Git - php/commitdiff
more tests
authorAnatol Belski <ab@php.net>
Wed, 17 Jun 2015 22:15:34 +0000 (00:15 +0200)
committerAnatol Belski <ab@php.net>
Wed, 17 Jun 2015 22:15:34 +0000 (00:15 +0200)
Zend/tests/exception_018.phpt [new file with mode: 0644]
Zend/tests/exception_019.phpt [new file with mode: 0644]

diff --git a/Zend/tests/exception_018.phpt b/Zend/tests/exception_018.phpt
new file mode 100644 (file)
index 0000000..aa39d53
--- /dev/null
@@ -0,0 +1,15 @@
+--TEST--
+Testing throw exception doesn't crash with wrong params, variant 1
+--FILE--
+<?php
+
+class Hello extends Exception {}
+throw new Hello(new stdClass);
+
+?>
+--EXPECTF--
+Fatal error: Uncaught Error: Wrong parameters for Hello([string $message [, long $code [, Throwable $previous = NULL]]]) in %sexception_018.php:%d
+Stack trace:
+#0 %sexception_018.php(%d): Exception->__construct(Object(stdClass))
+#1 {main}
+  thrown in %sexception_018.php on line %d
diff --git a/Zend/tests/exception_019.phpt b/Zend/tests/exception_019.phpt
new file mode 100644 (file)
index 0000000..4ebb077
--- /dev/null
@@ -0,0 +1,14 @@
+--TEST--
+Testing throw exception doesn't crash with wrong params, variant 2
+--FILE--
+<?php
+
+throw new Exception(new stdClass);
+
+?>
+--EXPECTF--
+Fatal error: Uncaught Error: Wrong parameters for Exception([string $message [, long $code [, Throwable $previous = NULL]]]) in %sexception_019.php:%d
+Stack trace:
+#0 %sexception_019.php(%d): Exception->__construct(Object(stdClass))
+#1 {main}
+  thrown in %sexception_019.php on line %d