@@ -19,7 +19,7 @@ class SignalSocketHelperTest extends TestCase
1919
2020 private $ backupSigIntHandler ;
2121
22- public function setUp (): void
22+ protected function setUp (): void
2323 {
2424 parent ::setUp ();
2525
@@ -28,16 +28,16 @@ public function setUp(): void
2828 $ this ->markTestSkipped ('PHP 7.1+ needed ' );
2929 }
3030
31- $ this ->backupSigTermHandler = pcntl_signal_get_handler (SIGTERM );
32- $ this ->backupSigIntHandler = pcntl_signal_get_handler (SIGINT );
31+ $ this ->backupSigTermHandler = pcntl_signal_get_handler (\ SIGTERM );
32+ $ this ->backupSigIntHandler = pcntl_signal_get_handler (\ SIGINT );
3333
34- pcntl_signal (SIGTERM , SIG_DFL );
35- pcntl_signal (SIGINT , SIG_DFL );
34+ pcntl_signal (\ SIGTERM , \ SIG_DFL );
35+ pcntl_signal (\ SIGINT , \ SIG_DFL );
3636
3737 $ this ->signalHelper = new SignalSocketHelper ();
3838 }
3939
40- public function tearDown (): void
40+ protected function tearDown (): void
4141 {
4242 parent ::tearDown ();
4343
@@ -46,11 +46,11 @@ public function tearDown(): void
4646 }
4747
4848 if ($ this ->backupSigTermHandler ) {
49- pcntl_signal (SIGTERM , $ this ->backupSigTermHandler );
49+ pcntl_signal (\ SIGTERM , $ this ->backupSigTermHandler );
5050 }
5151
5252 if ($ this ->backupSigIntHandler ) {
53- pcntl_signal (SIGINT , $ this ->backupSigIntHandler );
53+ pcntl_signal (\ SIGINT , $ this ->backupSigIntHandler );
5454 }
5555 }
5656
@@ -71,7 +71,7 @@ public function testShouldRegisterHandlerOnBeforeSocketAndBackupCurrentOne()
7171 {
7272 $ handler = function () {};
7373
74- pcntl_signal (SIGTERM , $ handler );
74+ pcntl_signal (\ SIGTERM , $ handler );
7575
7676 $ this ->signalHelper ->beforeSocket ();
7777
@@ -80,8 +80,8 @@ public function testShouldRegisterHandlerOnBeforeSocketAndBackupCurrentOne()
8080 $ handlers = $ this ->readAttribute ($ this ->signalHelper , 'handlers ' );
8181
8282 self ::assertIsArray ($ handlers );
83- $ this ->assertArrayHasKey (SIGTERM , $ handlers );
84- $ this ->assertSame ($ handler , $ handlers [SIGTERM ]);
83+ $ this ->assertArrayHasKey (\ SIGTERM , $ handlers );
84+ $ this ->assertSame ($ handler , $ handlers [\ SIGTERM ]);
8585 }
8686
8787 public function testRestoreDefaultPropertiesOnAfterSocket ()
@@ -97,12 +97,12 @@ public function testRestorePreviousHandlerOnAfterSocket()
9797 {
9898 $ handler = function () {};
9999
100- pcntl_signal (SIGTERM , $ handler );
100+ pcntl_signal (\ SIGTERM , $ handler );
101101
102102 $ this ->signalHelper ->beforeSocket ();
103103 $ this ->signalHelper ->afterSocket ();
104104
105- $ this ->assertSame ($ handler , pcntl_signal_get_handler (SIGTERM ));
105+ $ this ->assertSame ($ handler , pcntl_signal_get_handler (\ SIGTERM ));
106106 }
107107
108108 public function testThrowsIfBeforeSocketCalledSecondTime ()
@@ -118,7 +118,7 @@ public function testShouldReturnTrueOnWasThereSignal()
118118 {
119119 $ this ->signalHelper ->beforeSocket ();
120120
121- posix_kill (getmypid (), SIGINT );
121+ posix_kill (getmypid (), \ SIGINT );
122122 pcntl_signal_dispatch ();
123123
124124 $ this ->assertTrue ($ this ->signalHelper ->wasThereSignal ());
0 commit comments