File tree Expand file tree Collapse file tree 2 files changed +14
-0
lines changed
Expand file tree Collapse file tree 2 files changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -26,6 +26,11 @@ public function __construct()
2626
2727 public function beforeSocket ()
2828 {
29+ // PHP 7.1 and higher
30+ if (false == function_exists ('pcntl_signal_get_handler ' )) {
31+ return ;
32+ }
33+
2934 if ($ this ->handlers ) {
3035 throw new \LogicException ('The handlers property should be empty but it is not. The afterSocket method might not have been called. ' );
3136 }
@@ -52,6 +57,11 @@ public function beforeSocket()
5257
5358 public function afterSocket ()
5459 {
60+ // PHP 7.1 and higher
61+ if (false == function_exists ('pcntl_signal_get_handler ' )) {
62+ return ;
63+ }
64+
5565 $ this ->wasThereSignal = null ;
5666
5767 foreach ($ this ->signals as $ signal ) {
Original file line number Diff line number Diff line change @@ -20,6 +20,10 @@ public function setUp()
2020 {
2121 parent ::setUp ();
2222
23+ if (false == function_exists ('pcntl_signal_get_handler ' )) {
24+ $ this ->markTestSkipped ('PHP 7.1 and higher ' );
25+ }
26+
2327 $ this ->backupSigTermHandler = pcntl_signal_get_handler (SIGTERM );
2428 $ this ->backupSigIntHandler = pcntl_signal_get_handler (SIGINT );
2529
You can’t perform that action at this time.
0 commit comments