Skip to content

Commit bf185ed

Browse files
committed
pcntl_signal_get_handler doesnt exist pre 7.1
1 parent 8c3eef5 commit bf185ed

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

tests/RedisSimpleLockFactoryTest.php

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,10 @@ public function testCreateIgnoredSAPIsLock()
1919
$lock = $factory->create('lock identifier');
2020
$this->assertInstanceOf(RedisSimpleLock::class, $lock);
2121

22-
$handler = pcntl_signal_get_handler(SIGINT);
23-
$this->assertEmpty($handler);
22+
if (function_exists('pcntl_signal_get_handler')) {
23+
$handler = pcntl_signal_get_handler(SIGINT);
24+
$this->assertEmpty($handler);
25+
}
2426
}
2527

2628
public function testCreateLock()
@@ -29,7 +31,9 @@ public function testCreateLock()
2931
$lock = $factory->create('lock identifier');
3032
$this->assertInstanceOf(RedisSimpleLock::class, $lock);
3133

32-
$handler = pcntl_signal_get_handler(SIGINT);
33-
$this->assertInstanceOf(Closure::class, $handler);
34+
if (function_exists('pcntl_signal_get_handler')) {
35+
$handler = pcntl_signal_get_handler(SIGINT);
36+
$this->assertInstanceOf(Closure::class, $handler);
37+
}
3438
}
3539
}

0 commit comments

Comments
 (0)