Skip to content

Commit b41ae59

Browse files
committed
Rename test case files for LanguageConstructSpacing sniff
Doing this to be able to move tests with syntax errors to their own file.
1 parent aeb53ae commit b41ae59

File tree

3 files changed

+36
-28
lines changed

3 files changed

+36
-28
lines changed

src/Standards/Generic/Tests/WhiteSpace/LanguageConstructSpacingUnitTest.php

Lines changed: 36 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -26,37 +26,45 @@ class LanguageConstructSpacingUnitTest 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 => 1,
35-
7 => 1,
36-
11 => 1,
37-
15 => 1,
38-
19 => 1,
39-
23 => 1,
40-
27 => 1,
41-
30 => 1,
42-
33 => 1,
43-
34 => 1,
44-
35 => 1,
45-
36 => 1,
46-
38 => 1,
47-
44 => 1,
48-
45 => 1,
49-
46 => 2,
50-
49 => 1,
51-
51 => 1,
52-
59 => 1,
53-
61 => 1,
54-
63 => 1,
55-
67 => 1,
56-
70 => 1,
57-
71 => 1,
58-
75 => 1,
59-
];
35+
switch ($testFile) {
36+
case 'LanguageConstructSpacingUnitTest.1.inc':
37+
return [
38+
3 => 1,
39+
7 => 1,
40+
11 => 1,
41+
15 => 1,
42+
19 => 1,
43+
23 => 1,
44+
27 => 1,
45+
30 => 1,
46+
33 => 1,
47+
34 => 1,
48+
35 => 1,
49+
36 => 1,
50+
38 => 1,
51+
44 => 1,
52+
45 => 1,
53+
46 => 2,
54+
49 => 1,
55+
51 => 1,
56+
59 => 1,
57+
61 => 1,
58+
63 => 1,
59+
67 => 1,
60+
70 => 1,
61+
71 => 1,
62+
75 => 1,
63+
];
64+
65+
default:
66+
return [];
67+
}//end switch
6068

6169
}//end getErrorList()
6270

0 commit comments

Comments
 (0)