File tree Expand file tree Collapse file tree 1 file changed +25
-0
lines changed Expand file tree Collapse file tree 1 file changed +25
-0
lines changed Original file line number Diff line number Diff line change @@ -422,6 +422,31 @@ public function dataSuppressLine()
422422 }//end dataSuppressLine()
423423
424424
425+ /**
426+ * Test suppressing a single error using a single line ignore in the middle of a line.
427+ *
428+ * @covers PHP_CodeSniffer\Tokenizers\Tokenizer::createPositionMap
429+ *
430+ * @return void
431+ */
432+ public function testSuppressLineMidLine ()
433+ {
434+ $ config = new Config ();
435+ $ config ->standards = ['Generic ' ];
436+ $ config ->sniffs = ['Generic.PHP.LowerCaseConstant ' ];
437+
438+ $ ruleset = new Ruleset ($ config );
439+
440+ $ content = '<?php ' .PHP_EOL .'$var = FALSE; /* @phpcs:ignore */ $var = FALSE; ' ;
441+ $ file = new DummyFile ($ content , $ ruleset , $ config );
442+ $ file ->process ();
443+
444+ $ this ->assertSame (0 , $ file ->getErrorCount ());
445+ $ this ->assertCount (0 , $ file ->getErrors ());
446+
447+ }//end testSuppressLineMidLine()
448+
449+
425450 /**
426451 * Test suppressing a single error using a single line ignore within a docblock.
427452 *
You can’t perform that action at this time.
0 commit comments