Skip to content

Commit adc6510

Browse files
committed
Generic/LowercasedFilename: improve code coverage
1 parent 7f5d178 commit adc6510

File tree

3 files changed

+20
-1
lines changed

3 files changed

+20
-1
lines changed

src/Standards/Generic/Sniffs/Files/LowercasedFilenameSniff.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ public function process(File $phpcsFile, $stackPtr)
4444
{
4545
$filename = $phpcsFile->getFilename();
4646
if ($filename === 'STDIN') {
47-
return $phpcsFile->numTokens;
47+
return $phpcsFile->numTokens; // @codeCoverageIgnore
4848
}
4949

5050
$filename = basename($filename);

src/Standards/Generic/Tests/Files/LowercasedFilenameUnitTest.php

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,24 @@ final class LowercasedFilenameUnitTest extends AbstractSniffUnitTest
2020
{
2121

2222

23+
/**
24+
* Get a list of all test files to check.
25+
*
26+
* @param string $testFileBase The base path that the unit tests files will have.
27+
*
28+
* @return string[]
29+
*/
30+
protected function getTestFiles($testFileBase)
31+
{
32+
$testFileDir = dirname($testFileBase);
33+
$testFiles = parent::getTestFiles($testFileBase);
34+
$testFiles[] = $testFileDir.DIRECTORY_SEPARATOR.'lowercased_filename_unit_test.inc';
35+
36+
return $testFiles;
37+
38+
}//end getTestFiles()
39+
40+
2341
/**
2442
* Returns the lines where errors should occur.
2543
*
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
<?php

0 commit comments

Comments
 (0)