Skip to content

Commit 7fdd9c4

Browse files
committed
Normalize line endings
1 parent 6615cdd commit 7fdd9c4

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/Testing/RuleTestCase.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@
4141
use function count;
4242
use function implode;
4343
use function sprintf;
44+
use function str_replace;
4445

4546
/**
4647
* @api
@@ -211,7 +212,12 @@ public function fix(string $file, string $expectedFile): void
211212

212213
$fixedFileContents = FileReader::read($expectedFile);
213214

214-
$this->assertSame($fixedFileContents, $newFileContents);
215+
$this->assertSame($this->normalizeLineEndings($fixedFileContents), $this->normalizeLineEndings($newFileContents));
216+
}
217+
218+
private function normalizeLineEndings(string $string): string
219+
{
220+
return str_replace("\r\n", "\n", $string);
215221
}
216222

217223
/**

0 commit comments

Comments
 (0)