Skip to content

Commit 8bd51e0

Browse files
committed
normalized line ending
1 parent 908372a commit 8bd51e0

File tree

1 file changed

+8
-9
lines changed

1 file changed

+8
-9
lines changed

tests/ChangesReporting/Output/JsonOutputFormatterTest.php

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ public function testGetName(): void
3131

3232
public function testReportShouldShowNumberOfChangesWithNoDiffs(): void
3333
{
34-
$this->expectOsOutputString((string) file_get_contents(__DIR__ . '/Fixtures/without_diffs.json'));
34+
ob_start();
3535

3636
$this->jsonOutputFormatter->report(
3737
new ProcessResult(
@@ -56,15 +56,14 @@ public function testReportShouldShowNumberOfChangesWithNoDiffs(): void
5656
),
5757
new Configuration(showDiffs: false)
5858
);
59-
}
6059

61-
protected function expectOsOutputString(string $expectedOutput): void
62-
{
63-
$isWindows = strncasecmp(PHP_OS, 'WIN', 3) === 0;
64-
if ($isWindows) {
65-
$expectedOutput = str_replace('%0A', '%0D%0A', $expectedOutput);
66-
}
60+
$actualOutput = ob_get_clean();
61+
$expectedOutput = (string) file_get_contents(__DIR__ . '/Fixtures/without_diffs.json');
62+
63+
// Normalize line endings for comparison
64+
$actualOutput = str_replace("\r\n", "\n", $actualOutput);
65+
$expectedOutput = str_replace("\r\n", "\n", $expectedOutput);
6766

68-
parent::expectOutputString($expectedOutput);
67+
$this->assertSame($expectedOutput, $actualOutput);
6968
}
7069
}

0 commit comments

Comments
 (0)