Passed
Push — master ( efa86f...55c9f6 )
by Petr
10:18
created

StylesTest::testSimple()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 12
Code Lines 10

Duplication

Lines 0
Ratio 0 %

Importance

Changes 2
Bugs 0 Features 0
Metric Value
eloc 10
c 2
b 0
f 0
dl 0
loc 12
rs 9.9332
cc 1
nc 1
nop 0
1
<?php
2
3
namespace BasicTests;
4
5
6
use CommonTestClass;
7
use kalanis\kw_templates\HtmlElement\TAttributes;
8
use kalanis\kw_templates\HtmlElement\TStyles;
9
10
11
/**
12
 * Class StylesTest
13
 * @package BasicTests
14
 * How to check traits? Extend them.
15
 */
16
class StylesTest extends CommonTestClass
17
{
18
    public function testSimple()
19
    {
20
        $data = new Styles();
21
        $this->assertEmpty($data->getAttributes());
22
        $this->assertEmpty($data->getAttribute('style'));
23
        $data->addCss('foo', 'snt');
24
        $data->addCss('bar', 'fgs');
25
        $data->addCss('baz', 'sdf');
26
        $this->assertEquals('sdf', $data->getCss('baz'));
27
        $this->assertEquals('foo:snt;bar:fgs;baz:sdf;', $data->getAttribute('style'));
28
        $data->removeCss('bar');
29
        $this->assertEquals('foo:snt;baz:sdf;', $data->getAttribute('style'));
30
    }
31
}
32
33
34
class Styles
35
{
36
    use TAttributes, TStyles;
37
}
38