@@ -335,7 +335,10 @@ public function testSuppressLine()
335335 {
336336 $ config = new Config ();
337337 $ config ->standards = ['Generic ' ];
338- $ config ->sniffs = ['Generic.PHP.LowerCaseConstant ' ];
338+ $ config ->sniffs = [
339+ 'Generic.PHP.LowerCaseConstant ' ,
340+ 'Generic.Files.LineLength ' ,
341+ ];
339342
340343 $ ruleset = new Ruleset ($ config );
341344
@@ -379,7 +382,7 @@ public function testSuppressLine()
379382 $ this ->assertEquals (1 , $ numErrors );
380383 $ this ->assertCount (1 , $ errors );
381384
382- // Process with @ suppression on line before.
385+ // Process with @ suppression on line before.
383386 $ content = '<?php ' .PHP_EOL .'/* @phpcs:ignore */ ' .PHP_EOL .'$var = FALSE; ' .PHP_EOL .'$var = FALSE; ' ;
384387 $ file = new DummyFile ($ content , $ ruleset , $ config );
385388 $ file ->process ();
@@ -399,6 +402,16 @@ public function testSuppressLine()
399402 $ this ->assertEquals (1 , $ numErrors );
400403 $ this ->assertCount (1 , $ errors );
401404
405+ // Process with @ suppression on line before inside docblock.
406+ $ content = '<?php ' .PHP_EOL .'/** ' .PHP_EOL .' * Comment here ' .PHP_EOL .' * @phpcs:ignore ' .PHP_EOL .' * ' .str_repeat ('a ' , 50 ).PHP_EOL .'*/ ' ;
407+ $ file = new DummyFile ($ content , $ ruleset , $ config );
408+ $ file ->process ();
409+
410+ $ errors = $ file ->getErrors ();
411+ $ numErrors = $ file ->getErrorCount ();
412+ $ this ->assertEquals (0 , $ numErrors );
413+ $ this ->assertCount (0 , $ errors );
414+
402415 // Process with suppression on same line.
403416 $ content = '<?php ' .PHP_EOL .'$var = FALSE; // phpcs:ignore ' .PHP_EOL .'$var = FALSE; ' ;
404417 $ file = new DummyFile ($ content , $ ruleset , $ config );
0 commit comments