Skip to content

Commit

Permalink
Generic/NestingLevel: 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 authored and jrfnl committed Dec 10, 2024
1 parent 50216b1 commit c1c8517
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 7 deletions.
28 changes: 21 additions & 7 deletions src/Standards/Generic/Tests/Metrics/NestingLevelUnitTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,18 @@ final class NestingLevelUnitTest 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 test file to process.
*
* @return array<int, int>
*/
public function getErrorList()
public function getErrorList($testFile='')
{
return [73 => 1];
switch ($testFile) {
case 'NestingLevelUnitTest.1.inc':
return [73 => 1];
default:
return [];
}

}//end getErrorList()

Expand All @@ -41,14 +48,21 @@ 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 test file to process.
*
* @return array<int, int>
*/
public function getWarningList()
public function getWarningList($testFile='')
{
return [
27 => 1,
46 => 1,
];
switch ($testFile) {
case 'NestingLevelUnitTest.1.inc':
return [
27 => 1,
46 => 1,
];
default:
return [];
}

}//end getWarningList()

Expand Down

0 comments on commit c1c8517

Please sign in to comment.