77use PHPUnit \Framework \TestCase ;
88use Sabberworm \CSS \OutputFormat ;
99use Sabberworm \CSS \Parser ;
10- use Sabberworm \CSS \Rule \ Rule ;
10+ use Sabberworm \CSS \Property \ Declaration ;
1111use Sabberworm \CSS \RuleSet \DeclarationBlock ;
1212use Sabberworm \CSS \Settings as ParserSettings ;
1313use Sabberworm \CSS \Value \Size ;
@@ -25,25 +25,25 @@ public function overrideRules(): void
2525 $ css = '.wrapper { left: 10px; text-align: left; } ' ;
2626 $ parser = new Parser ($ css );
2727 $ document = $ parser ->parse ();
28- $ rule = new Rule ('right ' );
29- $ rule ->setValue ('-10px ' );
28+ $ declaration = new Declaration ('right ' );
29+ $ declaration ->setValue ('-10px ' );
3030 $ contents = $ document ->getContents ();
3131 $ wrapper = $ contents [0 ];
3232
3333 self ::assertInstanceOf (DeclarationBlock::class, $ wrapper );
3434 self ::assertCount (2 , $ wrapper ->getRules ());
35- $ wrapper ->setRules ([$ rule ]);
35+ $ wrapper ->setRules ([$ declaration ]);
3636
37- $ rules = $ wrapper ->getRules ();
38- self ::assertCount (1 , $ rules );
39- self ::assertSame ('right ' , $ rules [0 ]->getRule ());
40- self ::assertSame ('-10px ' , $ rules [0 ]->getValue ());
37+ $ declarations = $ wrapper ->getRules ();
38+ self ::assertCount (1 , $ declarations );
39+ self ::assertSame ('right ' , $ declarations [0 ]->getRule ());
40+ self ::assertSame ('-10px ' , $ declarations [0 ]->getValue ());
4141 }
4242
4343 /**
4444 * @test
4545 */
46- public function ruleInsertion (): void
46+ public function declarationInsertion (): void
4747 {
4848 $ css = '.wrapper { left: 10px; text-align: left; } ' ;
4949 $ parser = new Parser ($ css );
@@ -53,34 +53,34 @@ public function ruleInsertion(): void
5353
5454 self ::assertInstanceOf (DeclarationBlock::class, $ wrapper );
5555
56- $ leftRules = $ wrapper ->getRules ('left ' );
57- self ::assertCount (1 , $ leftRules );
58- $ firstLeftRule = $ leftRules [0 ];
56+ $ leftDeclarations = $ wrapper ->getRules ('left ' );
57+ self ::assertCount (1 , $ leftDeclarations );
58+ $ firstLeftDeclaration = $ leftDeclarations [0 ];
5959
60- $ textRules = $ wrapper ->getRules ('text- ' );
61- self ::assertCount (1 , $ textRules );
62- $ firstTextRule = $ textRules [0 ];
60+ $ textDeclarations = $ wrapper ->getRules ('text- ' );
61+ self ::assertCount (1 , $ textDeclarations );
62+ $ firstTextDeclaration = $ textDeclarations [0 ];
6363
64- $ leftPrefixRule = new Rule ('left ' );
65- $ leftPrefixRule ->setValue (new Size (16 , 'em ' ));
64+ $ leftPrefixDeclaration = new Declaration ('left ' );
65+ $ leftPrefixDeclaration ->setValue (new Size (16 , 'em ' ));
6666
67- $ textAlignRule = new Rule ('text-align ' );
68- $ textAlignRule ->setValue (new Size (1 ));
67+ $ textAlignDeclaration = new Declaration ('text-align ' );
68+ $ textAlignDeclaration ->setValue (new Size (1 ));
6969
70- $ borderBottomRule = new Rule ('border-bottom-width ' );
71- $ borderBottomRule ->setValue (new Size (1 , 'px ' ));
70+ $ borderBottomDeclaration = new Declaration ('border-bottom-width ' );
71+ $ borderBottomDeclaration ->setValue (new Size (1 , 'px ' ));
7272
73- $ wrapper ->addRule ($ borderBottomRule );
74- $ wrapper ->addRule ($ leftPrefixRule , $ firstLeftRule );
75- $ wrapper ->addRule ($ textAlignRule , $ firstTextRule );
73+ $ wrapper ->addRule ($ borderBottomDeclaration );
74+ $ wrapper ->addRule ($ leftPrefixDeclaration , $ firstLeftDeclaration );
75+ $ wrapper ->addRule ($ textAlignDeclaration , $ firstTextDeclaration );
7676
77- $ rules = $ wrapper ->getRules ();
77+ $ declarations = $ wrapper ->getRules ();
7878
79- self ::assertSame ($ leftPrefixRule , $ rules [0 ]);
80- self ::assertSame ($ firstLeftRule , $ rules [1 ]);
81- self ::assertSame ($ textAlignRule , $ rules [2 ]);
82- self ::assertSame ($ firstTextRule , $ rules [3 ]);
83- self ::assertSame ($ borderBottomRule , $ rules [4 ]);
79+ self ::assertSame ($ leftPrefixDeclaration , $ declarations [0 ]);
80+ self ::assertSame ($ firstLeftDeclaration , $ declarations [1 ]);
81+ self ::assertSame ($ textAlignDeclaration , $ declarations [2 ]);
82+ self ::assertSame ($ firstTextDeclaration , $ declarations [3 ]);
83+ self ::assertSame ($ borderBottomDeclaration , $ declarations [4 ]);
8484
8585 self ::assertSame (
8686 '.wrapper {left: 16em;left: 10px;text-align: 1;text-align: left;border-bottom-width: 1px;} ' ,
@@ -103,7 +103,7 @@ public static function declarationBlocksWithCommentsProvider(): array
103103 * @test
104104 * @dataProvider declarationBlocksWithCommentsProvider
105105 */
106- public function canRemoveCommentsFromRulesUsingLenientParsing (
106+ public function canRemoveCommentsFromDeclarationsUsingLenientParsing (
107107 string $ cssWithComments ,
108108 string $ cssWithoutComments
109109 ): void {
@@ -120,7 +120,7 @@ public function canRemoveCommentsFromRulesUsingLenientParsing(
120120 * @test
121121 * @dataProvider declarationBlocksWithCommentsProvider
122122 */
123- public function canRemoveCommentsFromRulesUsingStrictParsing (
123+ public function canRemoveCommentsFromDeclarationsUsingStrictParsing (
124124 string $ cssWithComments ,
125125 string $ cssWithoutComments
126126 ): void {
0 commit comments