com php-src: test timeout with exception variation: tests/basic/timeout_variation_6.phpt
| From: | Anatol Belski | Date: | Mon, 16 Mar 2015 18:26:17 +0000 |
| Subject: | com php-src: test timeout with exception variation: tests/basic/timeout_variation_6.phpt | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-85535@lists.php.net to get a copy of this message | ||
Commit: eab7da4bc91a60220bc8c6a208de1d324a7529aa
Author: Anatol Belski <ab@php.net> Mon, 16 Mar 2015 19:26:17 +0100
Parents: 1c0fce922ec5549bc127ad1238036e5d084f096c
Branches: master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=eab7da4bc91a60220bc8c6a208de1d324a7529aa
Log:
test timeout with exception variation
Changed paths:
A tests/basic/timeout_variation_6.phpt
Diff:
diff --git a/tests/basic/timeout_variation_6.phpt b/tests/basic/timeout_variation_6.phpt
new file mode 100644
index 0000000..387a358
--- /dev/null
+++ b/tests/basic/timeout_variation_6.phpt
@@ -0,0 +1,24 @@
+--TEST--
+Timeout within function trowing exteption before timeout reached
+--FILE--
+<?php
+
+$t = 3;
+set_time_limit($t);
+
+function f($t) {
+ echo "call";
+ sleep($t-1);
+ throw new Exception("exception before timeout");
+}
+
+f($t);
+?>
+never reached here
+--EXPECTF--
+call
+Fatal error: Uncaught exception 'Exception' with message 'exception before
timeout' in %s:%d
+Stack trace:
+#0 %s(%d): f(%d)
+#1 {main}
+ thrown in %s on line %d