diff --git a/src/Standards/Squiz/Tests/CSS/ShorthandSizeUnitTest.css b/src/Standards/Squiz/Tests/CSS/ShorthandSizeUnitTest.1.css similarity index 89% rename from src/Standards/Squiz/Tests/CSS/ShorthandSizeUnitTest.css rename to src/Standards/Squiz/Tests/CSS/ShorthandSizeUnitTest.1.css index cfc4503c41..c3d07ef5c4 100644 --- a/src/Standards/Squiz/Tests/CSS/ShorthandSizeUnitTest.css +++ b/src/Standards/Squiz/Tests/CSS/ShorthandSizeUnitTest.1.css @@ -39,7 +39,3 @@ 2px /* phpcs:disable Standard.Category.SniffName -- for reasons */ 4px; } - -/* Intentional parse error. Live coding resilience. This has to be the last test in the file. */ -#live-coding { - margin: 8px 8px 8px 8px diff --git a/src/Standards/Squiz/Tests/CSS/ShorthandSizeUnitTest.css.fixed b/src/Standards/Squiz/Tests/CSS/ShorthandSizeUnitTest.1.css.fixed similarity index 88% rename from src/Standards/Squiz/Tests/CSS/ShorthandSizeUnitTest.css.fixed rename to src/Standards/Squiz/Tests/CSS/ShorthandSizeUnitTest.1.css.fixed index 3472cb1743..36297dd60d 100644 --- a/src/Standards/Squiz/Tests/CSS/ShorthandSizeUnitTest.css.fixed +++ b/src/Standards/Squiz/Tests/CSS/ShorthandSizeUnitTest.1.css.fixed @@ -35,7 +35,3 @@ 2px /* phpcs:disable Standard.Category.SniffName -- for reasons */ 4px; } - -/* Intentional parse error. Live coding resilience. This has to be the last test in the file. */ -#live-coding { - margin: 8px 8px 8px 8px diff --git a/src/Standards/Squiz/Tests/CSS/ShorthandSizeUnitTest.2.css b/src/Standards/Squiz/Tests/CSS/ShorthandSizeUnitTest.2.css new file mode 100644 index 0000000000..2a91cf71a3 --- /dev/null +++ b/src/Standards/Squiz/Tests/CSS/ShorthandSizeUnitTest.2.css @@ -0,0 +1,3 @@ +/* Intentional parse error. Live coding resilience. */ +#live-coding { + margin: 8px 8px 8px 8px diff --git a/src/Standards/Squiz/Tests/CSS/ShorthandSizeUnitTest.php b/src/Standards/Squiz/Tests/CSS/ShorthandSizeUnitTest.php index 91ba7fb092..7394b77c2f 100644 --- a/src/Standards/Squiz/Tests/CSS/ShorthandSizeUnitTest.php +++ b/src/Standards/Squiz/Tests/CSS/ShorthandSizeUnitTest.php @@ -26,22 +26,30 @@ final class ShorthandSizeUnitTest extends AbstractSniffUnitTest * The key of the array should represent the line number and the value * should represent the number of errors that should occur on that line. * + * @param string $testFile The name of the file being tested. + * * @return array */ - public function getErrorList() + public function getErrorList($testFile='') { - return [ - 8 => 1, - 9 => 1, - 10 => 1, - 11 => 1, - 12 => 1, - 13 => 1, - 15 => 1, - 16 => 1, - 17 => 1, - 21 => 1, - ]; + switch ($testFile) { + case 'ShorthandSizeUnitTest.1.css': + return [ + 8 => 1, + 9 => 1, + 10 => 1, + 11 => 1, + 12 => 1, + 13 => 1, + 15 => 1, + 16 => 1, + 17 => 1, + 21 => 1, + ]; + + default: + return []; + }//end switch }//end getErrorList()