Skip to content

Commit 7463c78

Browse files
committed
Squiz/FunctionDeclarationArgumentSpacing: rename test case file
... to allow for adding additional test case files.
1 parent 0e0e0fb commit 7463c78

3 files changed

+64
-56
lines changed

src/Standards/Squiz/Tests/Functions/FunctionDeclarationArgumentSpacingUnitTest.php

Lines changed: 64 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -26,65 +26,73 @@ final class FunctionDeclarationArgumentSpacingUnitTest extends AbstractSniffUnit
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-
5 => 2,
36-
7 => 2,
37-
8 => 2,
38-
9 => 2,
39-
11 => 2,
40-
13 => 7,
41-
14 => 2,
42-
15 => 2,
43-
16 => 4,
44-
18 => 2,
45-
35 => 2,
46-
36 => 2,
47-
44 => 2,
48-
45 => 1,
49-
46 => 1,
50-
51 => 2,
51-
53 => 2,
52-
55 => 1,
53-
56 => 1,
54-
58 => 1,
55-
73 => 7,
56-
76 => 1,
57-
77 => 1,
58-
81 => 1,
59-
89 => 2,
60-
92 => 1,
61-
93 => 1,
62-
94 => 1,
63-
95 => 1,
64-
99 => 11,
65-
100 => 2,
66-
101 => 2,
67-
102 => 2,
68-
106 => 1,
69-
107 => 2,
70-
111 => 3,
71-
113 => 1,
72-
117 => 1,
73-
123 => 1,
74-
129 => 1,
75-
135 => 1,
76-
141 => 1,
77-
149 => 2,
78-
155 => 2,
79-
163 => 2,
80-
174 => 2,
81-
182 => 1,
82-
185 => 1,
83-
191 => 1,
84-
193 => 1,
85-
195 => 1,
86-
196 => 1,
87-
];
35+
switch ($testFile) {
36+
case 'FunctionDeclarationArgumentSpacingUnitTest.1.inc':
37+
return [
38+
3 => 1,
39+
5 => 2,
40+
7 => 2,
41+
8 => 2,
42+
9 => 2,
43+
11 => 2,
44+
13 => 7,
45+
14 => 2,
46+
15 => 2,
47+
16 => 4,
48+
18 => 2,
49+
35 => 2,
50+
36 => 2,
51+
44 => 2,
52+
45 => 1,
53+
46 => 1,
54+
51 => 2,
55+
53 => 2,
56+
55 => 1,
57+
56 => 1,
58+
58 => 1,
59+
73 => 7,
60+
76 => 1,
61+
77 => 1,
62+
81 => 1,
63+
89 => 2,
64+
92 => 1,
65+
93 => 1,
66+
94 => 1,
67+
95 => 1,
68+
99 => 11,
69+
100 => 2,
70+
101 => 2,
71+
102 => 2,
72+
106 => 1,
73+
107 => 2,
74+
111 => 3,
75+
113 => 1,
76+
117 => 1,
77+
123 => 1,
78+
129 => 1,
79+
135 => 1,
80+
141 => 1,
81+
149 => 2,
82+
155 => 2,
83+
163 => 2,
84+
174 => 2,
85+
182 => 1,
86+
185 => 1,
87+
191 => 1,
88+
193 => 1,
89+
195 => 1,
90+
196 => 1,
91+
];
92+
93+
default:
94+
return [];
95+
}//end switch
8896

8997
}//end getErrorList()
9098

0 commit comments

Comments
 (0)