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

HtmlTest   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Importance

Changes 2
Bugs 0 Features 0
Metric Value
wmc 2
eloc 9
c 2
b 0
f 0
dl 0
loc 16
rs 10
1
<?php
2
3
namespace BasicTests;
4
5
6
use CommonTestClass;
7
use kalanis\kw_templates\HtmlElement;
8
9
10
/**
11
 * Class HtmlTest
12
 * @package BasicTests
13
 * How to check traits? Extend them.
14
 */
15
class HtmlTest extends CommonTestClass
16
{
17
    public function testSimple1()
18
    {
19
        $data = HtmlElement::init('<hr align="left">', ['width' => '80',]);
20
        $this->assertNotEmpty($data->getAttributes());
21
        $this->assertEquals('left', $data->getAttribute('align'));
22
        $this->assertEquals('80', $data->getAttribute('width'));
23
    }
24
25
    public function testSimple2()
26
    {
27
        $data = HtmlElement::init('span', ['height' => '80',]);
28
        $this->assertNotEmpty($data->getAttributes());
29
        $this->assertEmpty($data->getAttribute('width'));
30
        $this->assertEquals('80', $data->getAttribute('height'));
31
    }
32
}
33