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

FormItemTest   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 13
dl 0
loc 20
rs 10
c 1
b 0
f 0
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A testInput() 0 18 1
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