Skip to content

Commit 676ed65

Browse files
committed
PSR12.Operators.OperatorSpacing: rename test files
There are no functional code changes being applied here. This is a preparation step to allow adding an additional test case file for this sniff later.
1 parent d6778b0 commit 676ed65

File tree

3 files changed

+30
-23
lines changed

3 files changed

+30
-23
lines changed

src/Standards/PSR12/Tests/Operators/OperatorSpacingUnitTest.php

Lines changed: 30 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -26,32 +26,39 @@ final class OperatorSpacingUnitTest 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-
2 => 1,
35-
3 => 2,
36-
4 => 1,
37-
5 => 2,
38-
6 => 4,
39-
9 => 3,
40-
10 => 2,
41-
11 => 3,
42-
13 => 3,
43-
14 => 2,
44-
18 => 1,
45-
20 => 1,
46-
22 => 2,
47-
23 => 2,
48-
26 => 1,
49-
37 => 4,
50-
39 => 1,
51-
40 => 1,
52-
44 => 2,
53-
47 => 2,
54-
];
35+
switch ($testFile) {
36+
case 'OperatorSpacingUnitTest.1.inc':
37+
return [
38+
2 => 1,
39+
3 => 2,
40+
4 => 1,
41+
5 => 2,
42+
6 => 4,
43+
9 => 3,
44+
10 => 2,
45+
11 => 3,
46+
13 => 3,
47+
14 => 2,
48+
18 => 1,
49+
20 => 1,
50+
22 => 2,
51+
23 => 2,
52+
26 => 1,
53+
37 => 4,
54+
39 => 1,
55+
40 => 1,
56+
44 => 2,
57+
47 => 2,
58+
];
59+
default:
60+
return [];
61+
}//end switch
5562

5663
}//end getErrorList()
5764

0 commit comments

Comments
 (0)