Passed
Push — master ( a5399b...1b2295 )
by Antony
08:34
created

KnockoutSwitchFieldTest::testKnockoutSwitchField()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 8
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 5
nc 1
nop 0
dl 0
loc 8
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace AntonyThorpe\Knockout\Tests;
4
5
use SilverStripe\Dev\SapphireTest;
6
use AntonyThorpe\Knockout\KnockoutSwitchField;
7
8
/**
9
 * KnockoutCheckboxFieldTest
10
 */
11
class KnockoutSwitchFieldTest extends SapphireTest
12
{
13
    public function testKnockoutSwitchField()
14
    {
15
        $field = KnockoutSwitchField::create("MyField", "This is a switchField")
16
            ->setObservable('switchField');
17
18
        $this->assertContains(
19
            '<input data-bind="checked: switchField',
20
            $field->Field()->getValue()
21
        );
22
    }
23
}
24