Passed
Push — master ( f12c86...a5399b )
by Antony
07:43
created

KnockoutSwitchFieldTest   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 10
Duplicated Lines 0 %

Importance

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

1 Method

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