Skip to content

Commit 7e282a0

Browse files
rodrigoprimojrfnl
authored andcommitted
Generic/SpaceAfterCast: rename test case file
Doing this to be able to create tests with syntax errors on separate files.
1 parent 544f9ab commit 7e282a0

File tree

3 files changed

+49
-41
lines changed

3 files changed

+49
-41
lines changed

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

+49-41
Original file line numberDiff line numberDiff line change
@@ -26,50 +26,58 @@ final class SpaceAfterCastUnitTest 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 test file to run.
30+
*
2931
* @return array<int, int>
3032
*/
31-
public function getErrorList()
33+
public function getErrorList($testFile='')
3234
{
33-
return [
34-
4 => 1,
35-
5 => 1,
36-
8 => 1,
37-
9 => 1,
38-
12 => 1,
39-
13 => 1,
40-
16 => 1,
41-
17 => 1,
42-
20 => 1,
43-
21 => 1,
44-
24 => 1,
45-
25 => 1,
46-
28 => 1,
47-
29 => 1,
48-
32 => 1,
49-
33 => 1,
50-
36 => 1,
51-
37 => 1,
52-
40 => 1,
53-
41 => 1,
54-
44 => 1,
55-
45 => 1,
56-
51 => 1,
57-
53 => 1,
58-
55 => 1,
59-
58 => 1,
60-
64 => 1,
61-
72 => 1,
62-
73 => 1,
63-
75 => 1,
64-
76 => 1,
65-
78 => 1,
66-
82 => 1,
67-
84 => 1,
68-
85 => 1,
69-
86 => 1,
70-
88 => 1,
71-
93 => 1,
72-
];
35+
switch ($testFile) {
36+
case 'SpaceAfterCastUnitTest.1.inc':
37+
return [
38+
4 => 1,
39+
5 => 1,
40+
8 => 1,
41+
9 => 1,
42+
12 => 1,
43+
13 => 1,
44+
16 => 1,
45+
17 => 1,
46+
20 => 1,
47+
21 => 1,
48+
24 => 1,
49+
25 => 1,
50+
28 => 1,
51+
29 => 1,
52+
32 => 1,
53+
33 => 1,
54+
36 => 1,
55+
37 => 1,
56+
40 => 1,
57+
41 => 1,
58+
44 => 1,
59+
45 => 1,
60+
51 => 1,
61+
53 => 1,
62+
55 => 1,
63+
58 => 1,
64+
64 => 1,
65+
72 => 1,
66+
73 => 1,
67+
75 => 1,
68+
76 => 1,
69+
78 => 1,
70+
82 => 1,
71+
84 => 1,
72+
85 => 1,
73+
86 => 1,
74+
88 => 1,
75+
93 => 1,
76+
];
77+
78+
default:
79+
return [];
80+
}//end switch
7381

7482
}//end getErrorList()
7583

0 commit comments

Comments
 (0)