66
77use PHPUnit \Framework \TestCase ;
88use Sabberworm \CSS \OutputFormat ;
9- use Sabberworm \CSS \Rule \ Rule ;
9+ use Sabberworm \CSS \Property \ Declaration ;
1010use Sabberworm \CSS \RuleSet \RuleSet ;
1111
1212/**
@@ -59,9 +59,9 @@ public static function providePropertyNamesAndValuesAndExpectedCss(): array
5959 *
6060 * @dataProvider providePropertyNamesAndValuesAndExpectedCss
6161 */
62- public function renderReturnsCssForRulesSet (array $ propertyNamesAndValuesToSet , string $ expectedCss ): void
62+ public function renderReturnsCssForDeclarationsSet (array $ propertyNamesAndValuesToSet , string $ expectedCss ): void
6363 {
64- $ this ->setRulesFromPropertyNamesAndValues ($ propertyNamesAndValuesToSet );
64+ $ this ->setDeclarationsFromPropertyNamesAndValues ($ propertyNamesAndValuesToSet );
6565
6666 $ result = $ this ->subject ->render (OutputFormat::create ());
6767
@@ -73,7 +73,7 @@ public function renderReturnsCssForRulesSet(array $propertyNamesAndValuesToSet,
7373 */
7474 public function renderWithCompactOutputFormatReturnsCssWithoutWhitespaceOrTrailingSemicolon (): void
7575 {
76- $ this ->setRulesFromPropertyNamesAndValues ([
76+ $ this ->setDeclarationsFromPropertyNamesAndValues ([
7777 ['name ' => 'color ' , 'value ' => 'green ' ],
7878 ['name ' => 'display ' , 'value ' => 'block ' ],
7979 ]);
@@ -88,7 +88,7 @@ public function renderWithCompactOutputFormatReturnsCssWithoutWhitespaceOrTraili
8888 */
8989 public function renderWithPrettyOutputFormatReturnsCssWithNewlinesAroundIndentedDeclarations (): void
9090 {
91- $ this ->setRulesFromPropertyNamesAndValues ([
91+ $ this ->setDeclarationsFromPropertyNamesAndValues ([
9292 ['name ' => 'color ' , 'value ' => 'green ' ],
9393 ['name ' => 'display ' , 'value ' => 'block ' ],
9494 ]);
@@ -101,19 +101,19 @@ public function renderWithPrettyOutputFormatReturnsCssWithNewlinesAroundIndented
101101 /**
102102 * @param list<array{name: string, value: string}> $propertyNamesAndValues
103103 */
104- private function setRulesFromPropertyNamesAndValues (array $ propertyNamesAndValues ): void
104+ private function setDeclarationsFromPropertyNamesAndValues (array $ propertyNamesAndValues ): void
105105 {
106- $ rulesToSet = \array_map (
106+ $ declarationsToSet = \array_map (
107107 /**
108108 * @param array{name: string, value: string} $nameAndValue
109109 */
110- static function (array $ nameAndValue ): Rule {
111- $ rule = new Rule ($ nameAndValue ['name ' ]);
112- $ rule ->setValue ($ nameAndValue ['value ' ]);
113- return $ rule ;
110+ static function (array $ nameAndValue ): Declaration {
111+ $ declaration = new Declaration ($ nameAndValue ['name ' ]);
112+ $ declaration ->setValue ($ nameAndValue ['value ' ]);
113+ return $ declaration ;
114114 },
115115 $ propertyNamesAndValues
116116 );
117- $ this ->subject ->setRules ($ rulesToSet );
117+ $ this ->subject ->setRules ($ declarationsToSet );
118118 }
119119}
0 commit comments