From 72a3d7c80b3b391833d9d683c3924fbff2c01436 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Schr=C3=B6der?= Date: Wed, 11 Jan 2017 09:16:27 +0100 Subject: [PATCH] Provide only signal constant names in data provider. --- tests/StreamSelectLoopTest.php | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/tests/StreamSelectLoopTest.php b/tests/StreamSelectLoopTest.php index 61b059c1..76560a43 100644 --- a/tests/StreamSelectLoopTest.php +++ b/tests/StreamSelectLoopTest.php @@ -40,9 +40,9 @@ public function testStreamSelectTimeoutEmulation() public function signalProvider() { return [ - ['SIGUSR1', SIGUSR1], - ['SIGHUP', SIGHUP], - ['SIGTERM', SIGTERM], + ['SIGUSR1'], + ['SIGHUP'], + ['SIGTERM'], ]; } @@ -52,7 +52,7 @@ public function signalProvider() * Test signal interrupt when no stream is attached to the loop * @dataProvider signalProvider */ - public function testSignalInterruptNoStream($sigName, $signal) + public function testSignalInterruptNoStream($signal) { if (!extension_loaded('pcntl')) { $this->markTestSkipped('"pcntl" extension is required to run this test.'); @@ -78,7 +78,7 @@ public function testSignalInterruptNoStream($sigName, $signal) * Test signal interrupt when a stream is attached to the loop * @dataProvider signalProvider */ - public function testSignalInterruptWithStream($sigName, $signal) + public function testSignalInterruptWithStream($signal) { if (!extension_loaded('pcntl')) { $this->markTestSkipped('"pcntl" extension is required to run this test.'); @@ -116,7 +116,7 @@ public function testSignalInterruptWithStream($sigName, $signal) protected function setUpSignalHandler($signal) { $this->_signalHandled = false; - $this->assertTrue(pcntl_signal($signal, function() { $this->_signalHandled = true; })); + $this->assertTrue(pcntl_signal(constant($signal), function() { $this->_signalHandled = true; })); } /** @@ -125,7 +125,7 @@ protected function setUpSignalHandler($signal) protected function resetSignalHandlers() { foreach($this->signalProvider() as $signal) { - pcntl_signal($signal[1], SIG_DFL); + pcntl_signal(constant($signal[0]), SIG_DFL); } } @@ -141,7 +141,7 @@ protected function forkSendSignal($signal) } else if ($childPid === 0) { // this is executed in the child process usleep(20000); - posix_kill($currentPid, $signal); + posix_kill($currentPid, constant($signal)); die(); } } pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy