@@ -10,7 +10,7 @@ class StreamSelectLoopTest extends AbstractLoopTest
10
10
protected function tearDown ()
11
11
{
12
12
parent ::tearDown ();
13
- if (strncmp ($ this ->getName (false ), 'testSignal ' , 10 ) === 0 ) {
13
+ if (strncmp ($ this ->getName (false ), 'testSignal ' , 10 ) === 0 && extension_loaded ( ' pcntl ' ) ) {
14
14
$ this ->resetSignalHandlers ();
15
15
}
16
16
}
@@ -54,6 +54,10 @@ public function signalProvider()
54
54
*/
55
55
public function testSignalInterruptNoStream ($ sigName , $ signal )
56
56
{
57
+ if (!extension_loaded ('pcntl ' )) {
58
+ $ this ->markTestSkipped ('"pcntl" extension is required to run this test. ' );
59
+ }
60
+
57
61
// dispatch signal handler once before signal is sent and once after
58
62
$ this ->loop ->addTimer (0.01 , function () { pcntl_signal_dispatch (); });
59
63
$ this ->loop ->addTimer (0.03 , function () { pcntl_signal_dispatch (); });
@@ -72,6 +76,10 @@ public function testSignalInterruptNoStream($sigName, $signal)
72
76
*/
73
77
public function testSignalInterruptWithStream ($ sigName , $ signal )
74
78
{
79
+ if (!extension_loaded ('pcntl ' )) {
80
+ $ this ->markTestSkipped ('"pcntl" extension is required to run this test. ' );
81
+ }
82
+
75
83
// dispatch signal handler every 10ms
76
84
$ this ->loop ->addPeriodicTimer (0.01 , function () { pcntl_signal_dispatch (); });
77
85
0 commit comments