mirror of
https://github.com/php/php-src.git
synced 2025-08-21 01:45:16 +02:00
- Added tests.
This commit is contained in:
parent
0f391bb0b3
commit
c41ae5f4b0
2 changed files with 59 additions and 0 deletions
22
tests/lang/catchable_error_001.phpt
Normal file
22
tests/lang/catchable_error_001.phpt
Normal file
|
@ -0,0 +1,22 @@
|
||||||
|
--TEST--
|
||||||
|
Catchable fatal error [1]
|
||||||
|
--FILE--
|
||||||
|
<?php
|
||||||
|
class Foo {
|
||||||
|
}
|
||||||
|
|
||||||
|
function blah (Foo $a)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
function error()
|
||||||
|
{
|
||||||
|
$a = func_get_args();
|
||||||
|
var_dump($a);
|
||||||
|
}
|
||||||
|
|
||||||
|
blah (new StdClass);
|
||||||
|
echo "ALIVE!\n";
|
||||||
|
?>
|
||||||
|
--EXPECTF--
|
||||||
|
Catchable fatal error: Argument 1 must be an instance of Foo, called in %scatchable_error_001.php on line 15 and defined in %scatchable_error_001.php on line 5
|
37
tests/lang/catchable_error_002.phpt
Normal file
37
tests/lang/catchable_error_002.phpt
Normal file
|
@ -0,0 +1,37 @@
|
||||||
|
--TEST--
|
||||||
|
Catchable fatal error [2]
|
||||||
|
--FILE--
|
||||||
|
<?php
|
||||||
|
class Foo {
|
||||||
|
}
|
||||||
|
|
||||||
|
function blah (Foo $a)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
function error()
|
||||||
|
{
|
||||||
|
$a = func_get_args();
|
||||||
|
var_dump($a);
|
||||||
|
}
|
||||||
|
|
||||||
|
set_error_handler('error');
|
||||||
|
|
||||||
|
blah (new StdClass);
|
||||||
|
echo "ALIVE!\n";
|
||||||
|
?>
|
||||||
|
--EXPECTF--
|
||||||
|
array(5) {
|
||||||
|
[0]=>
|
||||||
|
int(4096)
|
||||||
|
[1]=>
|
||||||
|
string(%d) "Argument 1 must be an instance of Foo, called in %scatchable_error_002.php on line 17 and defined"
|
||||||
|
[2]=>
|
||||||
|
string(%d) "%scatchable_error_002.php"
|
||||||
|
[3]=>
|
||||||
|
int(5)
|
||||||
|
[4]=>
|
||||||
|
array(0) {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
ALIVE!
|
Loading…
Add table
Add a link
Reference in a new issue