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

KnockoutNumericFieldTest   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Importance

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

1 Method

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