diff options
| author | Hannes Magnusson <bjori@php.net> | 2006-10-09 16:02:34 +0000 |
|---|---|---|
| committer | Hannes Magnusson <bjori@php.net> | 2006-10-09 16:02:34 +0000 |
| commit | e94670d4d6fde6bb34fd4e2ef7b00033d7ac6f31 (patch) | |
| tree | 28ef2083341aa38276a57282f6c13799e1b75cf7 /tests | |
| parent | 20fc2d427480db979c575d653b466853cca4b50e (diff) | |
| download | php-git-e94670d4d6fde6bb34fd4e2ef7b00033d7ac6f31.tar.gz | |
MFH tests
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/lang/catchable_error_001.phpt | 22 | ||||
| -rw-r--r-- | tests/lang/catchable_error_002.phpt | 37 |
2 files changed, 59 insertions, 0 deletions
diff --git a/tests/lang/catchable_error_001.phpt b/tests/lang/catchable_error_001.phpt new file mode 100644 index 0000000000..f6bbdd976d --- /dev/null +++ b/tests/lang/catchable_error_001.phpt @@ -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 passed to blah() must be an instance of Foo, instance of stdClass given, called in %scatchable_error_001.php on line 15 and defined in %scatchable_error_001.php on line 5 diff --git a/tests/lang/catchable_error_002.phpt b/tests/lang/catchable_error_002.phpt new file mode 100644 index 0000000000..c1762b2db7 --- /dev/null +++ b/tests/lang/catchable_error_002.phpt @@ -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 passed to blah() must be an instance of Foo, instance of stdClass given, called in %scatchable_error_002.php on line %d and defined" + [2]=> + string(%d) "%scatchable_error_002.php" + [3]=> + int(5) + [4]=> + array(0) { + } +} +ALIVE! |
