com php-src: add test for alone try block, and update test scripts summary: Zend/tests/try_catch_finally_002.phpt Zend/test
s/try_catch_finally_003.phpt Zend/tests/try_c atch_finally_004.phpt Zend/tests/try_finally_ 004.phpt
| From: | Xinchen Hui | Date: | Tue, 14 Aug 2012 06:08:38 +0000 |
| Subject: | com php-src: add test for alone try block, and update test scripts summary: Zend/tests/try_catch_finally_002.phpt Zend/test s/try_catch_finally_003.phpt Zend/tests/try_c atch_finally_004.phpt Zend/tests/try_finally_ 004.phpt |
||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-69827@lists.php.net to get a copy of this message | ||
Commit: f82be0550b573027b1fb8ef106e7c8efc78878e1
Author: Xinchen Hui <laruence@php.net> Tue, 14 Aug 2012 14:08:38 +0800
Parents: dacd918dc7745118f10ea9481ca081de523b97c9
Branches: master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=f82be0550b573027b1fb8ef106e7c8efc78878e1
Log:
add test for alone try block, and update test scripts summary
Changed paths:
M Zend/tests/try_catch_finally_002.phpt
M Zend/tests/try_catch_finally_003.phpt
M Zend/tests/try_catch_finally_004.phpt
A Zend/tests/try_finally_004.phpt
Diff:
diff --git a/Zend/tests/try_catch_finally_002.phpt b/Zend/tests/try_catch_finally_002.phpt
index 94143f6..79efcb3 100644
--- a/Zend/tests/try_catch_finally_002.phpt
+++ b/Zend/tests/try_catch_finally_002.phpt
@@ -1,5 +1,5 @@
--TEST--
-Try catch finally
+Try catch finally catch(multi catch blocks)
--FILE--
<?php
diff --git a/Zend/tests/try_catch_finally_003.phpt b/Zend/tests/try_catch_finally_003.phpt
index 78b37be..e605538 100644
--- a/Zend/tests/try_catch_finally_003.phpt
+++ b/Zend/tests/try_catch_finally_003.phpt
@@ -1,5 +1,5 @@
--TEST--
-Try catch finally
+Try catch finally (multi catch blcoks with return)
--FILE--
<?php
diff --git a/Zend/tests/try_catch_finally_004.phpt b/Zend/tests/try_catch_finally_004.phpt
index c694601..eb8d096 100644
--- a/Zend/tests/try_catch_finally_004.phpt
+++ b/Zend/tests/try_catch_finally_004.phpt
@@ -1,5 +1,5 @@
--TEST--
-Try catch finally
+Try catch finally (re-throw exception in catch block)
--CREDITS--
adoy
--FILE--
diff --git a/Zend/tests/try_finally_004.phpt b/Zend/tests/try_finally_004.phpt
new file mode 100644
index 0000000..8caa8fb
--- /dev/null
+++ b/Zend/tests/try_finally_004.phpt
@@ -0,0 +1,14 @@
+--TEST--
+Try without catch/finally block
+--FILE--
+<?php
+function foo () {
+ try {
+ echo "3";
+ }
+}
+
+foo();
+?>
+--EXPECTF--
+Fatal error: Cannot use try without catch or finally in %stry_finally_004.php on line %d