From 33adcdf0ccdd399102ba96dc3147ac50fcde9ae6 Mon Sep 17 00:00:00 2001 From: Marcus Boerger Date: Sun, 13 Jul 2008 21:37:27 +0000 Subject: [PATCH] - Fix/add tests --- Zend/tests/exception_007.phpt | 36 +++++++++++++++++++++++++++++++++++ Zend/tests/exception_008.phpt | 36 +++++++++++++++++++++++++++++++++++ Zend/tests/gc_030.phpt | 12 +++++++++++- 3 files changed, 83 insertions(+), 1 deletion(-) create mode 100755 Zend/tests/exception_007.phpt create mode 100755 Zend/tests/exception_008.phpt diff --git a/Zend/tests/exception_007.phpt b/Zend/tests/exception_007.phpt new file mode 100755 index 0000000000..953e76513b --- /dev/null +++ b/Zend/tests/exception_007.phpt @@ -0,0 +1,36 @@ +--TEST-- +Setting previous exception +--FILE-- + +===DONE=== +--EXPECTF-- +Fatal error: Uncaught exception 'Exception' with message 'Another' in %sexception_007.php:%d +Stack trace: +#0 {main} + +Next exception 'Exception' with message 'First' in %sexception_007.php:%d +Stack trace: +#0 {main} + +Next exception 'Exception' with message 'Second' in %sexception_007.php:%d +Stack trace: +#0 {main} + +Next exception 'Exception' with message 'Third' in %sexception_007.php:%d +Stack trace: +#0 {main} + thrown in %sexception_007.php on line %d diff --git a/Zend/tests/exception_008.phpt b/Zend/tests/exception_008.phpt new file mode 100755 index 0000000000..0d40541eee --- /dev/null +++ b/Zend/tests/exception_008.phpt @@ -0,0 +1,36 @@ +--TEST-- +Exception in __destruct while exception is pending +--FILE-- + +===DONE=== +--EXPECTF-- +Fatal error: Uncaught exception 'Exception' with message 'First' in %sexception_008.php:%d +Stack trace: +#0 %sexception_008.php(%d): TestFirst->__destruct() +#1 {main} + +Next exception 'Exception' with message 'Second' in %sexception_008.php:%d +Stack trace: +#0 %sexception_008.php(%d): TestSecond->__destruct() +#1 {main} + thrown in %sexception_008.php on line %d diff --git a/Zend/tests/gc_030.phpt b/Zend/tests/gc_030.phpt index 2c5e197bf8..4d051d2c88 100644 --- a/Zend/tests/gc_030.phpt +++ b/Zend/tests/gc_030.phpt @@ -18,4 +18,14 @@ unset($f1, $f2); gc_collect_cycles(); ?> --EXPECTF-- -Fatal error: Ignoring exception from foo::__destruct() while an exception is already active (Uncaught Exception in %sgc_030.php on line %d) in %sgc_030.php on line %d +Fatal error: Uncaught exception 'Exception' with message 'foobar' in %sgc_030.php:%d +Stack trace: +#0 [internal function]: foo->__destruct() +#1 %sgc_030.php(%d): gc_collect_cycles() +#2 {main} + +Next exception 'Exception' with message 'foobar' in %sgc_030.php:%d +Stack trace: +#0 %sgc_030.php(%d): foo->__destruct() +#1 {main} + thrown in %sgc_030.php on line %d -- 2.40.0