Skip to content

Commit 080cc38

Browse files
committed
Squiz/ScopeKeywordSpacing: rename the test case file
... to allow for adding additional test case files for this sniff.
1 parent 821b7cd commit 080cc38

File tree

3 files changed

+32
-24
lines changed

3 files changed

+32
-24
lines changed

src/Standards/Squiz/Tests/WhiteSpace/ScopeKeywordSpacingUnitTest.php

Lines changed: 32 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -26,33 +26,41 @@ class ScopeKeywordSpacingUnitTest 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-
7 => 2,
35-
8 => 1,
36-
13 => 1,
37-
14 => 1,
38-
15 => 1,
39-
17 => 2,
40-
26 => 1,
41-
28 => 1,
42-
29 => 1,
43-
64 => 1,
44-
67 => 1,
45-
71 => 1,
46-
103 => 1,
47-
106 => 1,
48-
111 => 1,
49-
119 => 1,
50-
121 => 1,
51-
127 => 2,
52-
134 => 2,
53-
138 => 2,
54-
140 => 3,
55-
];
35+
switch ($testFile) {
36+
case 'ScopeKeywordSpacingUnitTest.1.inc':
37+
return [
38+
7 => 2,
39+
8 => 1,
40+
13 => 1,
41+
14 => 1,
42+
15 => 1,
43+
17 => 2,
44+
26 => 1,
45+
28 => 1,
46+
29 => 1,
47+
64 => 1,
48+
67 => 1,
49+
71 => 1,
50+
103 => 1,
51+
106 => 1,
52+
111 => 1,
53+
119 => 1,
54+
121 => 1,
55+
127 => 2,
56+
134 => 2,
57+
138 => 2,
58+
140 => 3,
59+
];
60+
61+
default:
62+
return [];
63+
}//end switch
5664

5765
}//end getErrorList()
5866

0 commit comments

Comments
 (0)