From 68380d6952e113acf7bc122d629b9496d43a1a36 Mon Sep 17 00:00:00 2001 From: Christian Flothmann Date: Mon, 22 Jul 2024 13:02:29 +0200 Subject: [PATCH 1/2] be explicit about the signal to reset --- Tests/ApplicationTest.php | 10 ++++------ Tests/ConsoleEventsTest.php | 10 ++++------ Tests/SignalRegistry/SignalRegistryTest.php | 10 ++++------ 3 files changed, 12 insertions(+), 18 deletions(-) diff --git a/Tests/ApplicationTest.php b/Tests/ApplicationTest.php index d8e1ae8b9..ac1d47245 100644 --- a/Tests/ApplicationTest.php +++ b/Tests/ApplicationTest.php @@ -71,12 +71,10 @@ protected function tearDown(): void if (\function_exists('pcntl_signal')) { // We reset all signals to their default value to avoid side effects - for ($i = 1; $i <= 15; ++$i) { - if (9 === $i) { - continue; - } - pcntl_signal($i, \SIG_DFL); - } + pcntl_signal(\SIGINT, \SIG_DFL); + pcntl_signal(\SIGTERM, \SIG_DFL); + pcntl_signal(\SIGUSR1, \SIG_DFL); + pcntl_signal(\SIGUSR2, \SIG_DFL); } } diff --git a/Tests/ConsoleEventsTest.php b/Tests/ConsoleEventsTest.php index 93c228aa4..9c04d2706 100644 --- a/Tests/ConsoleEventsTest.php +++ b/Tests/ConsoleEventsTest.php @@ -35,12 +35,10 @@ protected function tearDown(): void if (\function_exists('pcntl_signal')) { pcntl_async_signals(false); // We reset all signals to their default value to avoid side effects - for ($i = 1; $i <= 15; ++$i) { - if (9 === $i) { - continue; - } - pcntl_signal($i, \SIG_DFL); - } + pcntl_signal(\SIGINT, \SIG_DFL); + pcntl_signal(\SIGTERM, \SIG_DFL); + pcntl_signal(\SIGUSR1, \SIG_DFL); + pcntl_signal(\SIGUSR2, \SIG_DFL); } } diff --git a/Tests/SignalRegistry/SignalRegistryTest.php b/Tests/SignalRegistry/SignalRegistryTest.php index 4cb435416..f997f7c1d 100644 --- a/Tests/SignalRegistry/SignalRegistryTest.php +++ b/Tests/SignalRegistry/SignalRegistryTest.php @@ -23,12 +23,10 @@ protected function tearDown(): void { pcntl_async_signals(false); // We reset all signals to their default value to avoid side effects - for ($i = 1; $i <= 15; ++$i) { - if (9 === $i) { - continue; - } - pcntl_signal($i, \SIG_DFL); - } + pcntl_signal(\SIGINT, \SIG_DFL); + pcntl_signal(\SIGTERM, \SIG_DFL); + pcntl_signal(\SIGUSR1, \SIG_DFL); + pcntl_signal(\SIGUSR2, \SIG_DFL); } public function testOneCallbackForASignalSignalIsHandled() From cef62396a0477e94fc52e87a17c6e5c32e226b7f Mon Sep 17 00:00:00 2001 From: Alexandre Daubois Date: Wed, 24 Jul 2024 10:06:13 +0200 Subject: [PATCH 2/2] [Console][PhpUnitBridge][VarDumper] Fix `NO_COLOR` empty value handling --- Output/StreamOutput.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Output/StreamOutput.php b/Output/StreamOutput.php index 5f5ffce32..72479f8a2 100644 --- a/Output/StreamOutput.php +++ b/Output/StreamOutput.php @@ -91,7 +91,7 @@ protected function doWrite(string $message, bool $newline) protected function hasColorSupport() { // Follow https://no-color.org/ - if (isset($_SERVER['NO_COLOR']) || false !== getenv('NO_COLOR')) { + if ('' !== ($_SERVER['NO_COLOR'] ?? getenv('NO_COLOR') ?: '')) { return false; }