Skip to content

Commit

Permalink
Merge pull request #180 from rodrigoprimo/improve-code-coverage-no-si…
Browse files Browse the repository at this point in the history
…lenced-errors

Generic/NoSilencedErrors: improve test coverage
  • Loading branch information
jrfnl authored Dec 25, 2023
2 parents 638c0d7 + 3b2f88f commit 5b9078f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
6 changes: 6 additions & 0 deletions src/Standards/Generic/Tests/PHP/NoSilencedErrorsUnitTest.inc
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,9 @@ if (@in_array($array, $needle))
}

$hasValue = @in_array(haystack: $array, needle: $needle);

// phpcs:set Generic.PHP.NoSilencedErrors error true
$fileContent = @file_get_contents('non_existent_file.txt');
// phpcs:set Generic.PHP.NoSilencedErrors error false

echo @$undefinedVariable;
3 changes: 2 additions & 1 deletion src/Standards/Generic/Tests/PHP/NoSilencedErrorsUnitTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class NoSilencedErrorsUnitTest extends AbstractSniffUnitTest
*/
public function getErrorList()
{
return [];
return [13 => 1];

}//end getErrorList()

Expand All @@ -48,6 +48,7 @@ public function getWarningList()
return [
5 => 1,
10 => 1,
16 => 1,
];

}//end getWarningList()
Expand Down

0 comments on commit 5b9078f

Please sign in to comment.