diff --git a/src/Standards/Generic/Tests/PHP/NoSilencedErrorsUnitTest.inc b/src/Standards/Generic/Tests/PHP/NoSilencedErrorsUnitTest.inc index 72bffe2c4c..98159b4725 100644 --- a/src/Standards/Generic/Tests/PHP/NoSilencedErrorsUnitTest.inc +++ b/src/Standards/Generic/Tests/PHP/NoSilencedErrorsUnitTest.inc @@ -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; diff --git a/src/Standards/Generic/Tests/PHP/NoSilencedErrorsUnitTest.php b/src/Standards/Generic/Tests/PHP/NoSilencedErrorsUnitTest.php index dc7e754d51..43f762812b 100644 --- a/src/Standards/Generic/Tests/PHP/NoSilencedErrorsUnitTest.php +++ b/src/Standards/Generic/Tests/PHP/NoSilencedErrorsUnitTest.php @@ -30,7 +30,7 @@ class NoSilencedErrorsUnitTest extends AbstractSniffUnitTest */ public function getErrorList() { - return []; + return [13 => 1]; }//end getErrorList() @@ -48,6 +48,7 @@ public function getWarningList() return [ 5 => 1, 10 => 1, + 16 => 1, ]; }//end getWarningList()