File: RuleTest.php

package info (click to toggle)
php-tijsverkoyen-css-to-inline-styles 2.3.0-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 340 kB
  • sloc: php: 1,105; makefile: 9
file content (29 lines) | stat: -rw-r--r-- 819 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
<?php

namespace TijsVerkoyen\CssToInlineStyles\Tests\Css\Rule;

use TijsVerkoyen\CssToInlineStyles\Css\Property\Property;
use TijsVerkoyen\CssToInlineStyles\Css\Rule\Rule;
use Symfony\Component\CssSelector\Node\Specificity;
use PHPUnit\Framework\TestCase;

class RuleTest extends TestCase
{
    public function testGetters(): void
    {
        $property = new Property('padding', '5px');
        $specificity = new Specificity(0, 0, 0);

        $rule = new Rule(
            'a',
            array($property),
            $specificity,
            1
        );

        $this->assertEquals('a', $rule->getSelector());
        $this->assertEquals(array($property), $rule->getProperties());
        $this->assertEquals($specificity, $rule->getSpecificity());
        $this->assertEquals(1, $rule->getOrder());
    }
}