You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: tests/Utils/UnifiedDiffAssertTraitTest.php
+18-18Lines changed: 18 additions & 18 deletions
Original file line number
Diff line number
Diff line change
@@ -95,7 +95,7 @@ public function testInvalidStartHeader3(): void
95
95
$this->expectExceptionMessageRegExp(\sprintf('#^%s$#', \preg_quote('Date of header line does not match expected pattern, got "[invalid date]". Line 1.', '#')));
96
96
97
97
$this->assertValidUnifiedDiffFormat(
98
-
"--- Original\t[invalid date]
98
+
"--- Original\t[invalid date]
99
99
+++ New
100
100
@@ -1,2 +1,2 @@
101
101
-A
@@ -111,7 +111,7 @@ public function testInvalidStartHeader4(): void
111
111
$this->expectExceptionMessageRegExp(\sprintf('#^%s$#', \preg_quote("Expected header line to start with \"+++ \", got \"+++INVALID\n\". Line 2.", '#')));
112
112
113
113
$this->assertValidUnifiedDiffFormat(
114
-
'--- Original
114
+
'--- Original
115
115
+++INVALID
116
116
@@ -1,2 +1,2 @@
117
117
-A
@@ -127,7 +127,7 @@ public function testInvalidLine1(): void
127
127
$this->expectExceptionMessageRegExp(\sprintf('#^%s$#', \preg_quote("Expected line to start with '@', '-' or '+', got \"1\n\". Line 5.", '#')));
128
128
129
129
$this->assertValidUnifiedDiffFormat(
130
-
'--- Original
130
+
'--- Original
131
131
+++ New
132
132
@@ -8 +8 @@
133
133
-Z
@@ -143,7 +143,7 @@ public function testInvalidLine2(): void
143
143
$this->expectExceptionMessageRegExp(\sprintf('#^%s$#', \preg_quote('Expected string length of minimal 2, got 1. Line 4.', '#')));
144
144
145
145
$this->assertValidUnifiedDiffFormat(
146
-
'--- Original
146
+
'--- Original
147
147
+++ New
148
148
@@ -8 +8 @@
149
149
@@ -158,7 +158,7 @@ public function testHunkInvalidFormat(): void
158
158
$this->expectExceptionMessageRegExp(\sprintf('#^%s$#', \preg_quote("Hunk header line does not match expected pattern, got \"@@ INVALID -1,1 +1,1 @@\n\". Line 3.", '#')));
159
159
160
160
$this->assertValidUnifiedDiffFormat(
161
-
'--- Original
161
+
'--- Original
162
162
+++ New
163
163
@@ INVALID -1,1 +1,1 @@
164
164
-Z
@@ -173,7 +173,7 @@ public function testHunkOverlapFrom(): void
173
173
$this->expectExceptionMessageRegExp(\sprintf('#^%s$#', \preg_quote('Unexpected new hunk; "from" (\'-\') start overlaps previous hunk. Line 6.', '#')));
174
174
175
175
$this->assertValidUnifiedDiffFormat(
176
-
'--- Original
176
+
'--- Original
177
177
+++ New
178
178
@@ -8,1 +8,1 @@
179
179
-Z
@@ -191,7 +191,7 @@ public function testHunkOverlapTo(): void
191
191
$this->expectExceptionMessageRegExp(\sprintf('#^%s$#', \preg_quote('Unexpected new hunk; "to" (\'+\') start overlaps previous hunk. Line 6.', '#')));
192
192
193
193
$this->assertValidUnifiedDiffFormat(
194
-
'--- Original
194
+
'--- Original
195
195
+++ New
196
196
@@ -8,1 +8,1 @@
197
197
-Z
@@ -209,7 +209,7 @@ public function testExpectHunk1(): void
209
209
$this->expectExceptionMessageRegExp(\sprintf('#^%s$#', \preg_quote('Expected hunk start (\'@\'), got "+". Line 6.', '#')));
210
210
211
211
$this->assertValidUnifiedDiffFormat(
212
-
'--- Original
212
+
'--- Original
213
213
+++ New
214
214
@@ -8 +8 @@
215
215
-Z
@@ -225,7 +225,7 @@ public function testExpectHunk2(): void
225
225
$this->expectExceptionMessageRegExp(\sprintf('#^%s$#', \preg_quote('Unexpected hunk start (\'@\'). Line 6.', '#')));
226
226
227
227
$this->assertValidUnifiedDiffFormat(
228
-
'--- Original
228
+
'--- Original
229
229
+++ New
230
230
@@ -8,12 +8,12 @@
231
231
' . '
@@ -241,7 +241,7 @@ public function testMisplacedLineAfterComments1(): void
241
241
$this->expectExceptionMessageRegExp(\sprintf('#^%s$#', \preg_quote('Unexpected line as 2 "No newline" markers have found, ". Line 8.', '#')));
242
242
243
243
$this->assertValidUnifiedDiffFormat(
244
-
'--- Original
244
+
'--- Original
245
245
+++ New
246
246
@@ -8 +8 @@
247
247
-Z
@@ -259,7 +259,7 @@ public function testMisplacedLineAfterComments2(): void
259
259
$this->expectExceptionMessageRegExp(\sprintf('#^%s$#', \preg_quote('Unexpected line as 2 "No newline" markers have found, ". Line 7.', '#')));
260
260
261
261
$this->assertValidUnifiedDiffFormat(
262
-
'--- Original
262
+
'--- Original
263
263
+++ New
264
264
@@ -8 +8 @@
265
265
+U
@@ -276,7 +276,7 @@ public function testMisplacedLineAfterComments3(): void
276
276
$this->expectExceptionMessageRegExp(\sprintf('#^%s$#', \preg_quote('Unexpected line as 2 "No newline" markers have found, ". Line 7.', '#')));
277
277
278
278
$this->assertValidUnifiedDiffFormat(
279
-
'--- Original
279
+
'--- Original
280
280
+++ New
281
281
@@ -8 +8 @@
282
282
+U
@@ -293,7 +293,7 @@ public function testMisplacedComment(): void
293
293
$this->expectExceptionMessageRegExp(\sprintf('#^%s$#', \preg_quote('Unexpected "\ No newline at end of file", it must be preceded by \'+\' or \'-\' line. Line 1.', '#')));
294
294
295
295
$this->assertValidUnifiedDiffFormat(
296
-
'\ No newline at end of file
296
+
'\ No newline at end of file
297
297
'
298
298
);
299
299
}
@@ -304,7 +304,7 @@ public function testUnexpectedDuplicateNoNewLineEOF(): void
304
304
$this->expectExceptionMessageRegExp(\sprintf('#^%s$#', \preg_quote('Unexpected "\\ No newline at end of file", "\\" was already closed. Line 8.', '#')));
305
305
306
306
$this->assertValidUnifiedDiffFormat(
307
-
'--- Original
307
+
'--- Original
308
308
+++ New
309
309
@@ -8,12 +8,12 @@
310
310
' . '
@@ -322,7 +322,7 @@ public function testFromAfterClose(): void
322
322
$this->expectExceptionMessageRegExp(\sprintf('#^%s$#', \preg_quote('Not expected from (\'-\'), already closed by "\ No newline at end of file". Line 6.', '#')));
323
323
324
324
$this->assertValidUnifiedDiffFormat(
325
-
'--- Original
325
+
'--- Original
326
326
+++ New
327
327
@@ -8,12 +8,12 @@
328
328
-A
@@ -390,7 +390,7 @@ public function testUnexpectedEOFFromMissingLines(): void
390
390
$this->expectExceptionMessageRegExp(\sprintf('#^%s$#', \preg_quote('Unexpected EOF, number of lines in hunk "from" (\'-\')) mismatched. Line 7.', '#')));
391
391
392
392
$this->assertValidUnifiedDiffFormat(
393
-
'--- Original
393
+
'--- Original
394
394
+++ New
395
395
@@ -8,19 +7,2 @@
396
396
-A
@@ -406,7 +406,7 @@ public function testUnexpectedEOFToMissingLines(): void
406
406
$this->expectExceptionMessageRegExp(\sprintf('#^%s$#', \preg_quote('Unexpected EOF, number of lines in hunk "to" (\'+\')) mismatched. Line 7.', '#')));
407
407
408
408
$this->assertValidUnifiedDiffFormat(
409
-
'--- Original
409
+
'--- Original
410
410
+++ New
411
411
@@ -8,2 +7,3 @@
412
412
-A
@@ -422,7 +422,7 @@ public function testUnexpectedEOFBothFromAndToMissingLines(): void
422
422
$this->expectExceptionMessageRegExp(\sprintf('#^%s$#', \preg_quote('Unexpected EOF, number of lines in hunk "from" (\'-\')) and "to" (\'+\') mismatched. Line 7.', '#')));
0 commit comments