@@ -40,9 +40,9 @@ public function testStreamSelectTimeoutEmulation()
40
40
public function signalProvider ()
41
41
{
42
42
return [
43
- ['SIGUSR1 ' , SIGUSR1 ],
44
- ['SIGHUP ' , SIGHUP ],
45
- ['SIGTERM ' , SIGTERM ],
43
+ ['SIGUSR1 ' ],
44
+ ['SIGHUP ' ],
45
+ ['SIGTERM ' ],
46
46
];
47
47
}
48
48
@@ -52,7 +52,7 @@ public function signalProvider()
52
52
* Test signal interrupt when no stream is attached to the loop
53
53
* @dataProvider signalProvider
54
54
*/
55
- public function testSignalInterruptNoStream ($ sigName , $ signal )
55
+ public function testSignalInterruptNoStream ($ signal )
56
56
{
57
57
if (!extension_loaded ('pcntl ' )) {
58
58
$ this ->markTestSkipped ('"pcntl" extension is required to run this test. ' );
@@ -78,7 +78,7 @@ public function testSignalInterruptNoStream($sigName, $signal)
78
78
* Test signal interrupt when a stream is attached to the loop
79
79
* @dataProvider signalProvider
80
80
*/
81
- public function testSignalInterruptWithStream ($ sigName , $ signal )
81
+ public function testSignalInterruptWithStream ($ signal )
82
82
{
83
83
if (!extension_loaded ('pcntl ' )) {
84
84
$ this ->markTestSkipped ('"pcntl" extension is required to run this test. ' );
@@ -116,7 +116,7 @@ public function testSignalInterruptWithStream($sigName, $signal)
116
116
protected function setUpSignalHandler ($ signal )
117
117
{
118
118
$ this ->_signalHandled = false ;
119
- $ this ->assertTrue (pcntl_signal ($ signal , function () { $ this ->_signalHandled = true ; }));
119
+ $ this ->assertTrue (pcntl_signal (constant ( $ signal) , function () { $ this ->_signalHandled = true ; }));
120
120
}
121
121
122
122
/**
@@ -125,7 +125,7 @@ protected function setUpSignalHandler($signal)
125
125
protected function resetSignalHandlers ()
126
126
{
127
127
foreach ($ this ->signalProvider () as $ signal ) {
128
- pcntl_signal ($ signal [1 ] , SIG_DFL );
128
+ pcntl_signal (constant ( $ signal [0 ]) , SIG_DFL );
129
129
}
130
130
}
131
131
@@ -141,7 +141,7 @@ protected function forkSendSignal($signal)
141
141
} else if ($ childPid === 0 ) {
142
142
// this is executed in the child process
143
143
usleep (20000 );
144
- posix_kill ($ currentPid , $ signal );
144
+ posix_kill ($ currentPid , constant ( $ signal) );
145
145
die ();
146
146
}
147
147
}
0 commit comments