Passed
Push — master ( bf3235...abf80a )
by Antony
02:59
created

KnockoutEmailFieldTest::testKnockoutEmailField()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 13
Code Lines 10

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 10
nc 1
nop 0
dl 0
loc 13
rs 9.9332
c 0
b 0
f 0
1
<?php
2
3
namespace AntonyThorpe\Knockout\Tests;
4
5
use SilverStripe\Dev\SapphireTest;
6
use AntonyThorpe\Knockout\KnockoutEmailField;
7
8
/**
9
 * KnockoutEmailFieldTest
10
 */
11
class KnockoutEmailFieldTest extends SapphireTest
12
{
13
14
    public function testKnockoutEmailField()
15
    {
16
        $field = KnockoutEmailField::create("MyField", "My Field")
17
            ->setObservable('email')
18
            ->setHasFocus(true);
19
        $this->assertEquals(
20
            "email",
21
            $field->getObservable(),
22
            "observable is set"
23
        );
24
        $this->assertTrue(
25
            $field->getHasFocus(),
26
            "Focus is set to True"
27
        );
28
    }
29
}
30