]> granicus.if.org Git - php/commitdiff
test timeout with exception variation
authorAnatol Belski <ab@php.net>
Mon, 16 Mar 2015 18:26:17 +0000 (19:26 +0100)
committerAnatol Belski <ab@php.net>
Mon, 16 Mar 2015 18:26:17 +0000 (19:26 +0100)
tests/basic/timeout_variation_6.phpt [new file with mode: 0644]

diff --git a/tests/basic/timeout_variation_6.phpt b/tests/basic/timeout_variation_6.phpt
new file mode 100644 (file)
index 0000000..387a358
--- /dev/null
@@ -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