Skip to content

Commit a5858bd

Browse files
rodrigoprimojrfnl
authored andcommitted
Generic/SpaceAfterNot: rename test case file
Doing this to be able to create tests with syntax errors on separate files.
1 parent 662b530 commit a5858bd

File tree

3 files changed

+38
-30
lines changed

3 files changed

+38
-30
lines changed

src/Standards/Generic/Tests/Formatting/SpaceAfterNotUnitTest.php

Lines changed: 38 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -26,39 +26,47 @@ final class SpaceAfterNotUnitTest extends AbstractSniffUnitTest
2626
* The key of the array should represent the line number and the value
2727
* should represent the number of errors that should occur on that line.
2828
*
29+
* @param string $testFile The name of the file being tested.
30+
*
2931
* @return array<int, int>
3032
*/
31-
public function getErrorList()
33+
public function getErrorList($testFile='')
3234
{
33-
return [
34-
3 => 2,
35-
4 => 2,
36-
5 => 2,
37-
6 => 1,
38-
7 => 1,
39-
8 => 1,
40-
11 => 1,
41-
14 => 1,
42-
17 => 1,
43-
20 => 1,
44-
28 => 1,
45-
38 => 2,
46-
39 => 2,
47-
40 => 1,
48-
41 => 1,
49-
42 => 1,
50-
48 => 1,
51-
51 => 1,
52-
56 => 2,
53-
57 => 1,
54-
58 => 1,
55-
59 => 1,
56-
62 => 1,
57-
65 => 1,
58-
68 => 1,
59-
71 => 1,
60-
79 => 1,
61-
];
35+
switch ($testFile) {
36+
case 'SpaceAfterNotUnitTest.1.inc':
37+
return [
38+
3 => 2,
39+
4 => 2,
40+
5 => 2,
41+
6 => 1,
42+
7 => 1,
43+
8 => 1,
44+
11 => 1,
45+
14 => 1,
46+
17 => 1,
47+
20 => 1,
48+
28 => 1,
49+
38 => 2,
50+
39 => 2,
51+
40 => 1,
52+
41 => 1,
53+
42 => 1,
54+
48 => 1,
55+
51 => 1,
56+
56 => 2,
57+
57 => 1,
58+
58 => 1,
59+
59 => 1,
60+
62 => 1,
61+
65 => 1,
62+
68 => 1,
63+
71 => 1,
64+
79 => 1,
65+
];
66+
67+
default:
68+
return [];
69+
}//end switch
6270

6371
}//end getErrorList()
6472

0 commit comments

Comments
 (0)