Skip to content

Commit 76aaf5e

Browse files
authored
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.
1 parent 237d567 commit 76aaf5e

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

tests/commands/RouteCommandTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,8 +123,8 @@ public function testGetRoutes(): void
123123
output; // phpcs:ignore
124124

125125
$this->assertStringContainsString(
126-
str_replace(PHP_EOL, '', $expected),
127-
str_replace(PHP_EOL, '', $this->removeColors(file_get_contents(static::$ou))),
126+
str_replace(["\r\n", "\n"], '', $expected),
127+
str_replace(["\r\n", "\n"], '', $this->removeColors(file_get_contents(static::$ou))),
128128
);
129129
}
130130

0 commit comments

Comments
 (0)