Add tests with invalid Error construction params

This commit is contained in:
Aaron Piotrowski 2015-06-17 19:49:02 -05:00
parent 8813b389ea
commit 4fb362704c
2 changed files with 29 additions and 0 deletions

View File

@ -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

View File

@ -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