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

KnockoutPasswordFieldTest   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 10
dl 0
loc 15
rs 10
c 0
b 0
f 0
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A testKnockoutPasswordField() 0 13 1
1
<?php
2
3
namespace AntonyThorpe\Knockout\Tests;
4
5
use SilverStripe\Dev\SapphireTest;
6
use AntonyThorpe\Knockout\KnockoutPasswordField;
7
8
/**
9
 * KnockoutPasswordFieldTest
10
 */
11
class KnockoutPasswordFieldTest extends SapphireTest
12
{
13
    public function testKnockoutPasswordField()
14
    {
15
        $field = KnockoutPasswordField::create("MyField", "My Field")
16
            ->setHasFocus(true);
17
18
        $this->assertEquals(
19
            "password",
20
            $field->getObservable(),
21
            "observable is set to password by default"
22
        );
23
        $this->assertTrue(
24
            $field->getHasFocus(),
25
            "Focus is set to True"
26
        );
27
    }
28
}
29