Passed
Push — develop ( 0005e4...c386f3 )
by Mathieu
01:39
created

FormItemTest::testInput()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 18
Code Lines 12

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 12
nc 1
nop 0
dl 0
loc 18
rs 9.8666
c 1
b 0
f 0
1
<?php
2
3
use \Suricate\FormItem;
4
5
/**
6
 * @SuppressWarnings("StaticAccess")
7
 */
8
class FormItemTest extends \PHPUnit\Framework\TestCase
9
{
10
    public function testInput()
11
    {
12
        $res = FormItem::input('text', 'myInput', "accentué", 'Mon input');
13
        $this->assertEquals(
14
            '<label for="myInput">Mon input</label><input type="text" name="myInput" id="myInput" value="accentu&eacute;"/>',
15
            $res
16
        );
17
18
        $res = FormItem::input('text', 'myInput', null, 'Mon input');
19
        $this->assertEquals(
20
            '<label for="myInput">Mon input</label><input type="text" name="myInput" id="myInput"/>',
21
            $res
22
        );
23
24
        $res = FormItem::input('text', 'myInput', "testval");
25
        $this->assertEquals(
26
            '<input type="text" name="myInput" value="testval"/>',
27
            $res
28
        );
29
    }
30
}
31