Completed
Push — master ( 2b7ec8...e65692 )
by Alex
09:34
created

LabelFieldUnitTest::testGetType()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 9
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 3
nc 1
nop 0
dl 0
loc 9
rs 10
c 0
b 0
f 0
1
<?php
2
namespace Mezon\Gui\Field\Tests;
3
4
class LabelFieldUnitTest extends \PHPUnit\Framework\TestCase
5
{
6
7
    /**
8
     * Testing constructor
9
     */
10
    public function testConstructor()
11
    {
12
        // setup
13
        $field = new \Mezon\Gui\Field\LabelField([
14
            'text' => 'name'
15
        ]);
16
17
        // test body
18
        $content = $field->html();
19
20
        // assertions
21
        $this->assertStringContainsString(
22
            '<label class="control-label">name</label>',
23
            $content,
24
            'Label was not generated');
25
    }
26
27
    /**
28
     * Testing getType method
29
     */
30
    public function testGetType(): void
31
    {
32
        // setup
33
        $field = new \Mezon\Gui\Field\LabelField([
34
            'text' => 'name'
35
        ]);
36
37
        // test body and assertions
38
        $this->assertStringContainsString('label', $field->getType());
39
    }
40
41
    /**
42
     * Testing fillAllRow method
43
     */
44
    public function testFillAllRow(): void
45
    {
46
        // setup
47
        $field = new \Mezon\Gui\Field\LabelField([
48
            'text' => 'name'
49
        ]);
50
51
        // test body and assertions
52
        $this->assertTrue($field->fillAllRow());
53
    }
54
}
55