ElementTest::newElementAddsBooleanAttributes()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 3
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 6
rs 10
1
<?php
2
3
namespace Jhoff\BladeVue\Testing\Unit;
4
5
use Jhoff\BladeVue\Element;
6
use Jhoff\BladeVue\Testing\TestCase;
7
8
class ElementTest extends TestCase
9
{
10
    /**
11
     * @test
12
     */
13
    public function newElementSetsTagName()
14
    {
15
        $element = new Element('newTag');
16
17
        $this->assertEquals('<newTag>', $element->getStartTag());
18
        $this->assertEquals('</newTag>', $element->getEndTag());
19
    }
20
21
    /**
22
     * @test
23
     */
24
    public function newElementAddsBooleanAttributes()
25
    {
26
        $element = (new Element('newTag'))
27
            ->setAttribute('foobar', null);
28
29
        $this->assertEquals('<newTag foobar>', $element->getStartTag());
30
    }
31
32
    /**
33
     * @test
34
     */
35
    public function newElementAddsValueAttributes()
36
    {
37
        $element = (new Element('newTag'))
38
            ->setAttribute('foobar', 'bazqux');
39
40
        $this->assertEquals('<newTag foobar="bazqux">', $element->getStartTag());
41
    }
42
}
43