Skip to content

Commit b0a122e

Browse files
committed
Fixed #3 (Moved signal handling check before handler call)
1 parent fcba4ad commit b0a122e

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

Diff for: src/Test.php

+7-4
Original file line numberDiff line numberDiff line change
@@ -209,6 +209,13 @@ function provideRegistrationArgs()
209209

210210
/** @dataProvider provideRegistrationArgs */
211211
function testWeakTypes($type, $args) {
212+
if ($type == "onSignal") {
213+
$this->testSignalCapability();
214+
if (!\extension_loaded("posix")) {
215+
$this->markTestSkipped("ext/posix required to test signal handlers");
216+
}
217+
}
218+
212219
$this->start(function (Driver $loop) use ($type, $args, &$invoked) {
213220
if ($type == "onReadable") {
214221
$ends = stream_socket_pair(\stripos(PHP_OS, "win") === 0 ? STREAM_PF_INET : STREAM_PF_UNIX, STREAM_SOCK_STREAM, STREAM_IPPROTO_IP);
@@ -238,10 +245,6 @@ function testWeakTypes($type, $args) {
238245
call_user_func_array([$loop, $type], $args);
239246

240247
if ($type == "onSignal") {
241-
$this->testSignalCapability();
242-
if (!\extension_loaded("posix")) {
243-
$this->markTestSkipped("ext/posix required to test signal handlers");
244-
}
245248
$loop->defer(function() {
246249
\posix_kill(\getmypid(), \SIGUSR1);
247250
});

0 commit comments

Comments
 (0)