File tree Expand file tree Collapse file tree 2 files changed +41
-35
lines changed Expand file tree Collapse file tree 2 files changed +41
-35
lines changed Original file line number Diff line number Diff line change
1
+ <?php
2
+
3
+ declare (strict_types=1 );
4
+
5
+ namespace Sabberworm \CSS \Tests \Functional \RuleSet ;
6
+
7
+ use PHPUnit \Framework \TestCase ;
8
+ use Sabberworm \CSS \OutputFormat ;
9
+ use Sabberworm \CSS \Property \Selector ;
10
+ use Sabberworm \CSS \Rule \Rule ;
11
+ use Sabberworm \CSS \RuleSet \DeclarationBlock ;
12
+
13
+ /**
14
+ * @covers \Sabberworm\CSS\RuleSet\DeclarationBlock
15
+ */
16
+ final class DeclarationBlockTest extends TestCase
17
+ {
18
+ /**
19
+ * @test
20
+ */
21
+ public function rendersRulesInOrderProvided (): void
22
+ {
23
+ $ declarationBlock = new DeclarationBlock ();
24
+ $ declarationBlock ->setSelectors ([new Selector ('.test ' )]);
25
+
26
+ $ rule1 = new Rule ('background-color ' );
27
+ $ rule1 ->setValue ('transparent ' );
28
+ $ declarationBlock ->addRule ($ rule1 );
29
+
30
+ $ rule2 = new Rule ('background ' );
31
+ $ rule2 ->setValue ('#222 ' );
32
+ $ declarationBlock ->addRule ($ rule2 );
33
+
34
+ $ rule3 = new Rule ('background-color ' );
35
+ $ rule3 ->setValue ('#fff ' );
36
+ $ declarationBlock ->addRule ($ rule3 );
37
+
38
+ $ expectedRendering = 'background-color: transparent;background: #222 ' ;
39
+ self ::assertStringContainsString ($ expectedRendering , $ declarationBlock ->render (new OutputFormat ()));
40
+ }
41
+ }
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments