File tree Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -428,4 +428,26 @@ public function orderOfElementsMatchingOriginalOrderAfterExpandingShorthands():
428428 \array_map ('strval ' , $ lastDeclarationBlock ->getRulesAssoc ())
429429 );
430430 }
431+
432+ /**
433+ * @return array<string, array{0: non-empty-string, 1: non-empty-string}>
434+ */
435+ public static function declarationBlocksWithCommentsProvider (): array
436+ {
437+ return [
438+ 'CSS comments with one asterisk ' => ['p {color: #000;/* black */} ' , 'p {color: #000;} ' ],
439+ 'CSS comments with two asterisks ' => ['p {color: #000;/** black */} ' , 'p {color: #000;} ' ],
440+ ];
441+ }
442+
443+ /**
444+ * @test
445+ * @dataProvider declarationBlocksWithCommentsProvider
446+ */
447+ public function removesCommentsFromRules (string $ cssWithComments , string $ cssWithoutComments ): void
448+ {
449+ $ document = (new Parser ($ cssWithComments ))->parse ();
450+
451+ self ::assertSame ($ cssWithoutComments , $ document ->render ());
452+ }
431453}
You can’t perform that action at this time.
0 commit comments