Skip to content

Commit

Permalink
Generic/CyclomaticComplexity: rename test case file
Browse files Browse the repository at this point in the history
Doing this to be able to create tests with syntax errors on separate
files.
  • Loading branch information
rodrigoprimo committed Nov 14, 2024
1 parent 7f5d178 commit dbc1663
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,18 @@ final class CyclomaticComplexityUnitTest extends AbstractSniffUnitTest
* The key of the array should represent the line number and the value
* should represent the number of errors that should occur on that line.
*
* @param string $testFile The name of the file being tested.
*
* @return array<int, int>
*/
public function getErrorList()
public function getErrorList($testFile='')
{
return [118 => 1];
switch ($testFile) {
case 'CyclomaticComplexityUnitTest.1.inc':
return [118 => 1];
default:
return [];
}

}//end getErrorList()

Expand All @@ -41,21 +48,28 @@ public function getErrorList()
* The key of the array should represent the line number and the value
* should represent the number of warnings that should occur on that line.
*
* @param string $testFile The name of the file being tested.
*
* @return array<int, int>
*/
public function getWarningList()
public function getWarningList($testFile='')
{
return [
45 => 1,
72 => 1,
189 => 1,
237 => 1,
285 => 1,
333 => 1,
381 => 1,
417 => 1,
445 => 1,
];
switch ($testFile) {
case 'CyclomaticComplexityUnitTest.1.inc':
return [
45 => 1,
72 => 1,
189 => 1,
237 => 1,
285 => 1,
333 => 1,
381 => 1,
417 => 1,
445 => 1,
];
default:
return [];
}

}//end getWarningList()

Expand Down

0 comments on commit dbc1663

Please sign in to comment.