Skip to content

Commit 90e3190

Browse files
committed
Generic/ConstructorName: rename test case file
... to allow for adding additional test case files for parse error tests.
1 parent f947742 commit 90e3190

File tree

2 files changed

+22
-15
lines changed

2 files changed

+22
-15
lines changed

src/Standards/Generic/Tests/NamingConventions/ConstructorNameUnitTest.php

Lines changed: 22 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -26,24 +26,31 @@ final class ConstructorNameUnitTest 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 process.
30+
*
2931
* @return array<int, int>
3032
*/
31-
public function getErrorList()
33+
public function getErrorList($testFile='')
3234
{
33-
return [
34-
6 => 1,
35-
11 => 1,
36-
47 => 1,
37-
62 => 1,
38-
91 => 1,
39-
103 => 1,
40-
104 => 1,
41-
112 => 1,
42-
120 => 1,
43-
121 => 1,
44-
126 => 1,
45-
127 => 1,
46-
];
35+
switch ($testFile) {
36+
case 'ConstructorNameUnitTest.1.inc':
37+
return [
38+
6 => 1,
39+
11 => 1,
40+
47 => 1,
41+
62 => 1,
42+
91 => 1,
43+
103 => 1,
44+
104 => 1,
45+
112 => 1,
46+
120 => 1,
47+
121 => 1,
48+
126 => 1,
49+
127 => 1,
50+
];
51+
default:
52+
return [];
53+
}//end switch
4754

4855
}//end getErrorList()
4956

0 commit comments

Comments
 (0)