Fix Windows CI failure in testGetRoutes: replace both \\r\\n and \\n newlines

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.
pull/702/head
copilot-swe-agent[bot] 2 days ago committed by GitHub
parent 237d567373
commit 76aaf5e274
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -123,8 +123,8 @@ PHP;
output; // phpcs:ignore output; // phpcs:ignore
$this->assertStringContainsString( $this->assertStringContainsString(
str_replace(PHP_EOL, '', $expected), str_replace(["\r\n", "\n"], '', $expected),
str_replace(PHP_EOL, '', $this->removeColors(file_get_contents(static::$ou))), str_replace(["\r\n", "\n"], '', $this->removeColors(file_get_contents(static::$ou))),
); );
} }

Loading…
Cancel
Save