Passed
Branch master (a5399b)
by Antony
01:41
created

testKnockoutCheckboxField()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 8
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 5
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 8
rs 10
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