summaryrefslogtreecommitdiff
path: root/ext/pcntl/tests
diff options
context:
space:
mode:
Diffstat (limited to 'ext/pcntl/tests')
-rw-r--r--ext/pcntl/tests/async_signals_2.phpt29
1 files changed, 29 insertions, 0 deletions
diff --git a/ext/pcntl/tests/async_signals_2.phpt b/ext/pcntl/tests/async_signals_2.phpt
new file mode 100644
index 0000000000..be631bab5e
--- /dev/null
+++ b/ext/pcntl/tests/async_signals_2.phpt
@@ -0,0 +1,29 @@
+--TEST--
+Async signals in zend_call_function
+--SKIPIF--
+<?php
+if (!extension_loaded("pcntl")) print "skip";
+if (getenv("SKIP_SLOW_TESTS")) print "skip slow test";
+?>
+--FILE--
+<?php
+
+pcntl_async_signals(1);
+pcntl_signal(SIGALRM, function($signo) {
+ throw new Exception("Alarm!");
+});
+
+pcntl_alarm(1);
+try {
+ array_map(
+ 'time_nanosleep',
+ array_fill(0, 360, 1),
+ array_fill(0, 360, 0)
+ );
+} catch (Exception $e) {
+ echo $e->getMessage(), "\n";
+}
+
+?>
+--EXPECT--
+Alarm!