Skip to content

Commit 0069734

Browse files
committed
minor #60356 don't hardcode OS-depending constant values (xabbuh)
This PR was merged into the 6.4 branch. Discussion ---------- don't hardcode OS-depending constant values | Q | A | ------------- | --- | Branch? | 6.4 | Bug fix? | no | New feature? | no | Deprecations? | no | Issues | | License | MIT The values of the `SIG*` constants depend on the OS. For example, on macOS the value of the `SIGSYS` constant is 12 and not 31 making the test added in #60168 fail. Commits ------- 3213d88 don't hardcode OS-depending constant values
2 parents 6b4f603 + 3213d88 commit 0069734

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

src/Symfony/Component/Console/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)