Conditions | 1 |
Paths | 1 |
Total Lines | 29 |
Code Lines | 22 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
13 | public function testKnockoutCheckboxField() |
||
14 | { |
||
15 | $field = KnockoutCheckboxField::create("MyField", "This is a checkbox") |
||
16 | ->setObservable('checkboxField') |
||
17 | ->setOtherBindings("blah: anotherFunction") |
||
18 | ->setHasFocus(true); |
||
19 | |||
20 | $this->assertEquals( |
||
21 | "checkboxField", |
||
22 | $field->getObservable(), |
||
23 | "observable is set" |
||
24 | ); |
||
25 | $this->assertEquals( |
||
26 | "blah: anotherFunction", |
||
27 | $field->getOtherBindings(), |
||
28 | "other bindings are set" |
||
29 | ); |
||
30 | $this->assertEquals( |
||
31 | "checked", |
||
32 | $field->getBindingType(), |
||
33 | "Default Binding Type is set" |
||
34 | ); |
||
35 | $this->assertTrue( |
||
36 | $field->getHasFocus(), |
||
37 | "Focus is set to True" |
||
38 | ); |
||
39 | $this->assertContains( |
||
40 | '<input data-bind="checked: checkboxField, blah: anotherFunction', |
||
41 | $field->Field()->getValue() |
||
42 | ); |
||
45 |