File tree Expand file tree Collapse file tree 1 file changed +23
-0
lines changed
tests/Sabberworm/CSS/RuleSet Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Original file line number Diff line number Diff line change @@ -264,4 +264,27 @@ public function testRuleInsertion() {
264
264
$ this ->assertSame ('.wrapper {left: 16em;left: 10px;text-align: 1;text-align: left;border-bottom-width: 1px;} ' , $ oDoc ->render ());
265
265
}
266
266
267
+ public function testOrderOfElementsMatchingOriginalOrderAfterExpandingShorthands ()
268
+ {
269
+ $ sCss = '.rule{padding:5px;padding-top: 20px} ' ;
270
+ $ oParser = new Parser ($ sCss );
271
+ $ oDoc = $ oParser ->parse ();
272
+ $ aDocs = $ oDoc ->getAllDeclarationBlocks ();
273
+
274
+ $ this ->assertCount (1 , $ aDocs );
275
+
276
+ $ oDeclaration = array_pop ($ aDocs );
277
+ $ oDeclaration ->expandShorthands ();
278
+
279
+ $ this ->assertEqual (
280
+ array (
281
+ 'padding-top ' => 'padding-top:20px ' ,
282
+ 'padding-left ' => 'padding-top:5px ' ,
283
+ 'padding-rigth ' => 'padding-top:5px ' ,
284
+ 'padding-bottom ' => 'padding-top:5px ' ,
285
+ ),
286
+ array_map ('strval ' , $ oDeclaration ->getRulesAssoc ())
287
+ );
288
+ }
289
+
267
290
}
You can’t perform that action at this time.
0 commit comments