From 3213d880bfa3b603c291b4e6dadf93bd32553933 Mon Sep 17 00:00:00 2001 From: Christian Flothmann Date: Tue, 6 May 2025 11:08:27 +0200 Subject: [PATCH] don't hardcode OS-depending constant values The values of the SIG* constants depend on the OS. --- .../Console/Tests/SignalRegistry/SignalMapTest.php | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/Symfony/Component/Console/Tests/SignalRegistry/SignalMapTest.php b/src/Symfony/Component/Console/Tests/SignalRegistry/SignalMapTest.php index f4e320477d4be..73619049d6f4a 100644 --- a/src/Symfony/Component/Console/Tests/SignalRegistry/SignalMapTest.php +++ b/src/Symfony/Component/Console/Tests/SignalRegistry/SignalMapTest.php @@ -18,17 +18,21 @@ class SignalMapTest extends TestCase { /** * @requires extension pcntl - * - * @testWith [2, "SIGINT"] - * [9, "SIGKILL"] - * [15, "SIGTERM"] - * [31, "SIGSYS"] + * @dataProvider provideSignals */ public function testSignalExists(int $signal, string $expected) { $this->assertSame($expected, SignalMap::getSignalName($signal)); } + public function provideSignals() + { + yield [\SIGINT, 'SIGINT']; + yield [\SIGKILL, 'SIGKILL']; + yield [\SIGTERM, 'SIGTERM']; + yield [\SIGSYS, 'SIGSYS']; + } + public function testSignalDoesNotExist() { $this->assertNull(SignalMap::getSignalName(999999));