Skip to content

Commit c961b87

Browse files
SpacePossumsebastianbergmann
authored andcommitted
CS
1 parent 191aece commit c961b87

6 files changed

+26
-27
lines changed

tests/DifferTest.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
namespace SebastianBergmann\Diff;
1212

1313
use PHPUnit\Framework\TestCase;
14-
use SebastianBergmann\Diff\Output\UnifiedDiffOutputBuilder;
1514

1615
/**
1716
* @covers SebastianBergmann\Diff\Differ

tests/Output/Integration/StrictUnifiedDiffOutputBuilderIntegrationTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ public function testIntegrationDiffOutputBuilderVersusDiffCommand(string $diff,
203203
null,
204204
[
205205
'from' => $this->fileFrom,
206-
'to' => $this->fileTo,
206+
'to' => $this->fileTo,
207207
]
208208
);
209209

@@ -238,7 +238,7 @@ private function doIntegrationTestGitApply(string $diff, string $from, string $t
238238
$p->run(
239239
null,
240240
[
241-
'dir' => $this->dir,
241+
'dir' => $this->dir,
242242
'patch' => $this->filePatch,
243243
]
244244
);
@@ -260,7 +260,7 @@ private function doIntegrationTestPatch(string $diff, string $from, string $to):
260260
$p->run(
261261
null,
262262
[
263-
'from' => $this->fileFrom,
263+
'from' => $this->fileFrom,
264264
'patch' => $this->filePatch,
265265
]
266266
);

tests/Output/Integration/UnifiedDiffOutputBuilderIntegrationTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ private function doIntegrationTestPatch(string $diff, string $from, string $to):
9595
$p->run(
9696
null,
9797
[
98-
'from' => $this->fileFrom,
98+
'from' => $this->fileFrom,
9999
'patch' => $this->filePatch,
100100
]
101101
);
@@ -123,7 +123,7 @@ private function doIntegrationTestGitApply(string $diff, string $from, string $t
123123
$p->run(
124124
null,
125125
[
126-
'dir' => $this->dir,
126+
'dir' => $this->dir,
127127
'patch' => $this->filePatch,
128128
]
129129
);

tests/Output/StrictUnifiedDiffOutputBuilderTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,7 @@ public function testReUseBuilder(): void
275275

276276
$diff = $differ->diff("A\nB\n", "A\nX\n");
277277
$this->assertSame(
278-
'--- input.txt
278+
'--- input.txt
279279
+++ output.txt
280280
@@ -1,2 +1,2 @@
281281
A

tests/Utils/UnifiedDiffAssertTraitIntegrationTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,8 @@ public function testValidPatches(string $fileFrom, string $fileTo): void
4848
$p->run(
4949
null,
5050
[
51-
'from' => \realpath($fileFrom),
52-
'to' => \realpath($fileTo),
51+
'from' => \realpath($fileFrom),
52+
'to' => \realpath($fileTo),
5353
'patch' => $this->filePatch,
5454
]
5555
);

tests/Utils/UnifiedDiffAssertTraitTest.php

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ public function testInvalidStartHeader3(): void
9595
$this->expectExceptionMessageRegExp(\sprintf('#^%s$#', \preg_quote('Date of header line does not match expected pattern, got "[invalid date]". Line 1.', '#')));
9696

9797
$this->assertValidUnifiedDiffFormat(
98-
"--- Original\t[invalid date]
98+
"--- Original\t[invalid date]
9999
+++ New
100100
@@ -1,2 +1,2 @@
101101
-A
@@ -111,7 +111,7 @@ public function testInvalidStartHeader4(): void
111111
$this->expectExceptionMessageRegExp(\sprintf('#^%s$#', \preg_quote("Expected header line to start with \"+++ \", got \"+++INVALID\n\". Line 2.", '#')));
112112

113113
$this->assertValidUnifiedDiffFormat(
114-
'--- Original
114+
'--- Original
115115
+++INVALID
116116
@@ -1,2 +1,2 @@
117117
-A
@@ -127,7 +127,7 @@ public function testInvalidLine1(): void
127127
$this->expectExceptionMessageRegExp(\sprintf('#^%s$#', \preg_quote("Expected line to start with '@', '-' or '+', got \"1\n\". Line 5.", '#')));
128128

129129
$this->assertValidUnifiedDiffFormat(
130-
'--- Original
130+
'--- Original
131131
+++ New
132132
@@ -8 +8 @@
133133
-Z
@@ -143,7 +143,7 @@ public function testInvalidLine2(): void
143143
$this->expectExceptionMessageRegExp(\sprintf('#^%s$#', \preg_quote('Expected string length of minimal 2, got 1. Line 4.', '#')));
144144

145145
$this->assertValidUnifiedDiffFormat(
146-
'--- Original
146+
'--- Original
147147
+++ New
148148
@@ -8 +8 @@
149149
@@ -158,7 +158,7 @@ public function testHunkInvalidFormat(): void
158158
$this->expectExceptionMessageRegExp(\sprintf('#^%s$#', \preg_quote("Hunk header line does not match expected pattern, got \"@@ INVALID -1,1 +1,1 @@\n\". Line 3.", '#')));
159159

160160
$this->assertValidUnifiedDiffFormat(
161-
'--- Original
161+
'--- Original
162162
+++ New
163163
@@ INVALID -1,1 +1,1 @@
164164
-Z
@@ -173,7 +173,7 @@ public function testHunkOverlapFrom(): void
173173
$this->expectExceptionMessageRegExp(\sprintf('#^%s$#', \preg_quote('Unexpected new hunk; "from" (\'-\') start overlaps previous hunk. Line 6.', '#')));
174174

175175
$this->assertValidUnifiedDiffFormat(
176-
'--- Original
176+
'--- Original
177177
+++ New
178178
@@ -8,1 +8,1 @@
179179
-Z
@@ -191,7 +191,7 @@ public function testHunkOverlapTo(): void
191191
$this->expectExceptionMessageRegExp(\sprintf('#^%s$#', \preg_quote('Unexpected new hunk; "to" (\'+\') start overlaps previous hunk. Line 6.', '#')));
192192

193193
$this->assertValidUnifiedDiffFormat(
194-
'--- Original
194+
'--- Original
195195
+++ New
196196
@@ -8,1 +8,1 @@
197197
-Z
@@ -209,7 +209,7 @@ public function testExpectHunk1(): void
209209
$this->expectExceptionMessageRegExp(\sprintf('#^%s$#', \preg_quote('Expected hunk start (\'@\'), got "+". Line 6.', '#')));
210210

211211
$this->assertValidUnifiedDiffFormat(
212-
'--- Original
212+
'--- Original
213213
+++ New
214214
@@ -8 +8 @@
215215
-Z
@@ -225,7 +225,7 @@ public function testExpectHunk2(): void
225225
$this->expectExceptionMessageRegExp(\sprintf('#^%s$#', \preg_quote('Unexpected hunk start (\'@\'). Line 6.', '#')));
226226

227227
$this->assertValidUnifiedDiffFormat(
228-
'--- Original
228+
'--- Original
229229
+++ New
230230
@@ -8,12 +8,12 @@
231231
' . '
@@ -241,7 +241,7 @@ public function testMisplacedLineAfterComments1(): void
241241
$this->expectExceptionMessageRegExp(\sprintf('#^%s$#', \preg_quote('Unexpected line as 2 "No newline" markers have found, ". Line 8.', '#')));
242242

243243
$this->assertValidUnifiedDiffFormat(
244-
'--- Original
244+
'--- Original
245245
+++ New
246246
@@ -8 +8 @@
247247
-Z
@@ -259,7 +259,7 @@ public function testMisplacedLineAfterComments2(): void
259259
$this->expectExceptionMessageRegExp(\sprintf('#^%s$#', \preg_quote('Unexpected line as 2 "No newline" markers have found, ". Line 7.', '#')));
260260

261261
$this->assertValidUnifiedDiffFormat(
262-
'--- Original
262+
'--- Original
263263
+++ New
264264
@@ -8 +8 @@
265265
+U
@@ -276,7 +276,7 @@ public function testMisplacedLineAfterComments3(): void
276276
$this->expectExceptionMessageRegExp(\sprintf('#^%s$#', \preg_quote('Unexpected line as 2 "No newline" markers have found, ". Line 7.', '#')));
277277

278278
$this->assertValidUnifiedDiffFormat(
279-
'--- Original
279+
'--- Original
280280
+++ New
281281
@@ -8 +8 @@
282282
+U
@@ -293,7 +293,7 @@ public function testMisplacedComment(): void
293293
$this->expectExceptionMessageRegExp(\sprintf('#^%s$#', \preg_quote('Unexpected "\ No newline at end of file", it must be preceded by \'+\' or \'-\' line. Line 1.', '#')));
294294

295295
$this->assertValidUnifiedDiffFormat(
296-
'\ No newline at end of file
296+
'\ No newline at end of file
297297
'
298298
);
299299
}
@@ -304,7 +304,7 @@ public function testUnexpectedDuplicateNoNewLineEOF(): void
304304
$this->expectExceptionMessageRegExp(\sprintf('#^%s$#', \preg_quote('Unexpected "\\ No newline at end of file", "\\" was already closed. Line 8.', '#')));
305305

306306
$this->assertValidUnifiedDiffFormat(
307-
'--- Original
307+
'--- Original
308308
+++ New
309309
@@ -8,12 +8,12 @@
310310
' . '
@@ -322,7 +322,7 @@ public function testFromAfterClose(): void
322322
$this->expectExceptionMessageRegExp(\sprintf('#^%s$#', \preg_quote('Not expected from (\'-\'), already closed by "\ No newline at end of file". Line 6.', '#')));
323323

324324
$this->assertValidUnifiedDiffFormat(
325-
'--- Original
325+
'--- Original
326326
+++ New
327327
@@ -8,12 +8,12 @@
328328
-A
@@ -390,7 +390,7 @@ public function testUnexpectedEOFFromMissingLines(): void
390390
$this->expectExceptionMessageRegExp(\sprintf('#^%s$#', \preg_quote('Unexpected EOF, number of lines in hunk "from" (\'-\')) mismatched. Line 7.', '#')));
391391

392392
$this->assertValidUnifiedDiffFormat(
393-
'--- Original
393+
'--- Original
394394
+++ New
395395
@@ -8,19 +7,2 @@
396396
-A
@@ -406,7 +406,7 @@ public function testUnexpectedEOFToMissingLines(): void
406406
$this->expectExceptionMessageRegExp(\sprintf('#^%s$#', \preg_quote('Unexpected EOF, number of lines in hunk "to" (\'+\')) mismatched. Line 7.', '#')));
407407

408408
$this->assertValidUnifiedDiffFormat(
409-
'--- Original
409+
'--- Original
410410
+++ New
411411
@@ -8,2 +7,3 @@
412412
-A
@@ -422,7 +422,7 @@ public function testUnexpectedEOFBothFromAndToMissingLines(): void
422422
$this->expectExceptionMessageRegExp(\sprintf('#^%s$#', \preg_quote('Unexpected EOF, number of lines in hunk "from" (\'-\')) and "to" (\'+\') mismatched. Line 7.', '#')));
423423

424424
$this->assertValidUnifiedDiffFormat(
425-
'--- Original
425+
'--- Original
426426
+++ New
427427
@@ -1,12 +1,14 @@
428428
-A

0 commit comments

Comments
 (0)