com php-src: Add tests with invalid Error construction params: Zend/tests/exception_021.phpt Zend/tests/exception _022.phpt

From: Date: Thu, 18 Jun 2015 00:49:02 +0000
Subject: com php-src: Add tests with invalid Error construction params: Zend/tests/exception_021.phpt Zend/tests/exception _022.phpt
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-87355@lists.php.net to get a copy of this message
Commit: 4fb362704cca3458b1ac500943415569c3c34ce8 Author: Aaron Piotrowski <aaron@trowski.com> Wed, 17 Jun 2015 19:49:02 -0500 Parents: 8813b389ea745b4dfaa72700844063de4de22859 Branches: master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=4fb362704cca3458b1ac500943415569c3c34ce8 Log: Add tests with invalid Error construction params Changed paths: A Zend/tests/exception_021.phpt A Zend/tests/exception_022.phpt Diff: diff --git a/Zend/tests/exception_021.phpt b/Zend/tests/exception_021.phpt new file mode 100644 index 0000000..5955e79 --- /dev/null +++ b/Zend/tests/exception_021.phpt @@ -0,0 +1,15 @@ +--TEST-- +Testing throw exception doesn't crash with wrong params, variant 3 +--FILE-- +<?php + +class Hello extends Error {} +throw new Hello(new stdClass); + +?> +--EXPECTF-- +Fatal error: Uncaught Error: Wrong parameters for Hello([string $message [, long $code [, Throwable $previous = NULL]]]) in %sexception_021.php:%d +Stack trace: +#0 %sexception_021.php(%d): Error->__construct(Object(stdClass)) +#1 {main} + thrown in %sexception_021.php on line %d diff --git a/Zend/tests/exception_022.phpt b/Zend/tests/exception_022.phpt new file mode 100644 index 0000000..83d4714 --- /dev/null +++ b/Zend/tests/exception_022.phpt @@ -0,0 +1,14 @@ +--TEST-- +Testing throw exception doesn't crash with wrong params, variant 4 +--FILE-- +<?php + +throw new Error(new stdClass); + +?> +--EXPECTF-- +Fatal error: Uncaught Error: Wrong parameters for Error([string $message [, long $code [, Throwable $previous = NULL]]]) in %sexception_022.php:%d +Stack trace: +#0 %sexception_022.php(%d): Error->__construct(Object(stdClass)) +#1 {main} + thrown in %sexception_022.php on line %d

« previous php.cvs (#87355) next »