mirror of
https://github.com/php/php-src.git
synced 2024-11-27 11:53:33 +08:00
Add tests with invalid Error construction params
This commit is contained in:
parent
8813b389ea
commit
4fb362704c
15
Zend/tests/exception_021.phpt
Normal file
15
Zend/tests/exception_021.phpt
Normal 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
|
14
Zend/tests/exception_022.phpt
Normal file
14
Zend/tests/exception_022.phpt
Normal 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
|
Loading…
Reference in New Issue
Block a user