@@ -18,27 +18,20 @@ final class IgnoreLineEndingTest extends TestCase
1818 /**
1919 * @return string[][]
2020 */
21- public function provideIgnoreLineEndingTrue (): array
21+ public function provideIgnoreLineEnding (): array
2222 {
2323 return [
2424 [
25- file_get_contents (__DIR__ . '/data/ignore_line_ending/old_1.txt ' ),
26- file_get_contents (__DIR__ . '/data/ignore_line_ending/new_1.txt ' ),
25+ \ file_get_contents (__DIR__ . '/data/ignore_line_ending/old_1.txt ' ),
26+ \ file_get_contents (__DIR__ . '/data/ignore_line_ending/new_1.txt ' ),
2727 <<<'DIFF'
2828DIFF
29+ ,
30+ true ,
2931 ],
30- ];
31- }
32-
33- /**
34- * @return string[][]
35- */
36- public function provideIgnoreLineEndingFalse (): array
37- {
38- return [
3932 [
40- file_get_contents (__DIR__ . '/data/ignore_line_ending/old_1.txt ' ),
41- file_get_contents (__DIR__ . '/data/ignore_line_ending/new_1.txt ' ),
33+ \ file_get_contents (__DIR__ . '/data/ignore_line_ending/old_1.txt ' ),
34+ \ file_get_contents (__DIR__ . '/data/ignore_line_ending/new_1.txt ' ),
4235 <<<"DIFF"
4336@@ -1,2 +1,2 @@
4437-line 1 \r
@@ -47,31 +40,23 @@ public function provideIgnoreLineEndingFalse(): array
4740+line 2
4841
4942DIFF
43+ ,
44+ false ,
5045 ],
5146 ];
5247 }
5348
5449 /**
55- * @dataProvider provideIgnoreLineEndingTrue
56- */
57- public function testIgnoreLineEndingTrue (string $ old , string $ new , string $ expectedDiff ): void
58- {
59- $ diff = DiffHelper::calculate ($ old , $ new , 'Unified ' , [
60- 'ignoreLineEnding ' => true ,
61- ], [
62- 'cliColorization ' => RendererConstant::CLI_COLOR_DISABLE ,
63- ]);
64-
65- static ::assertSame ($ expectedDiff , $ diff );
66- }
67-
68- /**
69- * @dataProvider provideIgnoreLineEndingFalse
50+ * @dataProvider provideIgnoreLineEnding
7051 */
71- public function testIgnoreLineEndingFalse (string $ old , string $ new , string $ expectedDiff ): void
72- {
52+ public function testIgnoreLineEnding (
53+ string $ old ,
54+ string $ new ,
55+ string $ expectedDiff ,
56+ bool $ gnoreLineEnding
57+ ): void {
7358 $ diff = DiffHelper::calculate ($ old , $ new , 'Unified ' , [
74- 'ignoreLineEnding ' => false ,
59+ 'ignoreLineEnding ' => $ gnoreLineEnding ,
7560 ], [
7661 'cliColorization ' => RendererConstant::CLI_COLOR_DISABLE ,
7762 ]);
0 commit comments