diff options
| author | Derick Rethans <derick@php.net> | 2005-09-15 16:20:06 +0000 |
|---|---|---|
| committer | Derick Rethans <derick@php.net> | 2005-09-15 16:20:06 +0000 |
| commit | c41ae5f4b0f1189d474cd95435fbfe957d24c965 (patch) | |
| tree | 48a055b62d751d900f05b98fa6a40897584be331 | |
| parent | 0f391bb0b350c4b91102314ec8920262fe72875a (diff) | |
| download | php-git-c41ae5f4b0f1189d474cd95435fbfe957d24c965.tar.gz | |
- Added 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..77492768f9 --- /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 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 diff --git a/tests/lang/catchable_error_002.phpt b/tests/lang/catchable_error_002.phpt new file mode 100644 index 0000000000..32d4b8bfe9 --- /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 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! |
