diff --git a/tests/RuleSet/DeclarationBlockTest.php b/tests/RuleSet/DeclarationBlockTest.php index 95625d37..5f8d392d 100644 --- a/tests/RuleSet/DeclarationBlockTest.php +++ b/tests/RuleSet/DeclarationBlockTest.php @@ -428,4 +428,26 @@ public function orderOfElementsMatchingOriginalOrderAfterExpandingShorthands(): \array_map('strval', $lastDeclarationBlock->getRulesAssoc()) ); } + + /** + * @return array + */ + public static function declarationBlocksWithCommentsProvider(): array + { + return [ + 'CSS comments with one asterisk' => ['p {color: #000;/* black */}', 'p {color: #000;}'], + 'CSS comments with two asterisks' => ['p {color: #000;/** black */}', 'p {color: #000;}'], + ]; + } + + /** + * @test + * @dataProvider declarationBlocksWithCommentsProvider + */ + public function removesCommentsFromRules(string $cssWithComments, string $cssWithoutComments): void + { + $document = (new Parser($cssWithComments))->parse(); + + self::assertSame($cssWithoutComments, $document->render()); + } }