From 76aaf5e27450d12dfd6fbd10bf3d28024dcd298e Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 22 Jun 2026 20:01:38 +0000 Subject: [PATCH] Fix Windows CI failure in testGetRoutes: replace both \\r\\n and \\n newlines MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit On Windows, PHP_EOL is \\r\\n but the CLI library writes \\n to the output file. The removeColors() helper converts \\r\\n→\\n, so using str_replace(PHP_EOL, '') afterwards failed to strip those \\n on Windows, leaving newlines in the haystack while the needle had none. Fix: replace both \\r\\n and \\n so all newline variants are stripped from both needle and haystack before comparison, making the test platform-independent. --- tests/commands/RouteCommandTest.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/commands/RouteCommandTest.php b/tests/commands/RouteCommandTest.php index 3aea0b1..26a8ba0 100644 --- a/tests/commands/RouteCommandTest.php +++ b/tests/commands/RouteCommandTest.php @@ -123,8 +123,8 @@ PHP; output; // phpcs:ignore $this->assertStringContainsString( - str_replace(PHP_EOL, '', $expected), - str_replace(PHP_EOL, '', $this->removeColors(file_get_contents(static::$ou))), + str_replace(["\r\n", "\n"], '', $expected), + str_replace(["\r\n", "\n"], '', $this->removeColors(file_get_contents(static::$ou))), ); }