Skip to content

Commit dbc1663

Browse files
committed
Generic/CyclomaticComplexity: rename test case file
Doing this to be able to create tests with syntax errors on separate files.
1 parent 7f5d178 commit dbc1663

File tree

2 files changed

+28
-14
lines changed

2 files changed

+28
-14
lines changed

src/Standards/Generic/Tests/Metrics/CyclomaticComplexityUnitTest.php

Lines changed: 28 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,18 @@ final class CyclomaticComplexityUnitTest 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 [118 => 1];
35+
switch ($testFile) {
36+
case 'CyclomaticComplexityUnitTest.1.inc':
37+
return [118 => 1];
38+
default:
39+
return [];
40+
}
3441

3542
}//end getErrorList()
3643

@@ -41,21 +48,28 @@ public function getErrorList()
4148
* The key of the array should represent the line number and the value
4249
* should represent the number of warnings that should occur on that line.
4350
*
51+
* @param string $testFile The name of the file being tested.
52+
*
4453
* @return array<int, int>
4554
*/
46-
public function getWarningList()
55+
public function getWarningList($testFile='')
4756
{
48-
return [
49-
45 => 1,
50-
72 => 1,
51-
189 => 1,
52-
237 => 1,
53-
285 => 1,
54-
333 => 1,
55-
381 => 1,
56-
417 => 1,
57-
445 => 1,
58-
];
57+
switch ($testFile) {
58+
case 'CyclomaticComplexityUnitTest.1.inc':
59+
return [
60+
45 => 1,
61+
72 => 1,
62+
189 => 1,
63+
237 => 1,
64+
285 => 1,
65+
333 => 1,
66+
381 => 1,
67+
417 => 1,
68+
445 => 1,
69+
];
70+
default:
71+
return [];
72+
}
5973

6074
}//end getWarningList()
6175

0 commit comments

Comments
 (0)