Skip to content

Commit d40c92e

Browse files
committed
don't hardcode OS-depending constant values
The values of the SIG* constants depend on the OS.
1 parent a3011c7 commit d40c92e

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

Tests/SignalRegistry/SignalMapTest.php

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,17 +18,21 @@ class SignalMapTest extends TestCase
1818
{
1919
/**
2020
* @requires extension pcntl
21-
*
22-
* @testWith [2, "SIGINT"]
23-
* [9, "SIGKILL"]
24-
* [15, "SIGTERM"]
25-
* [31, "SIGSYS"]
21+
* @dataProvider provideSignals
2622
*/
2723
public function testSignalExists(int $signal, string $expected)
2824
{
2925
$this->assertSame($expected, SignalMap::getSignalName($signal));
3026
}
3127

28+
public function provideSignals()
29+
{
30+
yield [\SIGINT, 'SIGINT'];
31+
yield [\SIGKILL, 'SIGKILL'];
32+
yield [\SIGTERM, 'SIGTERM'];
33+
yield [\SIGSYS, 'SIGSYS'];
34+
}
35+
3236
public function testSignalDoesNotExist()
3337
{
3438
$this->assertNull(SignalMap::getSignalName(999999));

0 commit comments

Comments
 (0)