| Conditions | 1 |
| Paths | 1 |
| Total Lines | 33 |
| Code Lines | 25 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 13 | public function testKnockoutTextField() |
||
| 14 | { |
||
| 15 | $field = KnockoutTextField::create("MyField", "My Field", null, 50) |
||
| 16 | ->setObservable('spaceship') |
||
| 17 | ->setBindingType('value') |
||
| 18 | ->setOtherBindings("valueUpdate: 'input'") |
||
| 19 | ->setHasFocus(true); |
||
| 20 | |||
| 21 | $this->assertEquals( |
||
| 22 | "spaceship", |
||
| 23 | $field->getObservable(), |
||
| 24 | "observable is set" |
||
| 25 | ); |
||
| 26 | $this->assertEquals( |
||
| 27 | "valueUpdate: 'input'", |
||
| 28 | $field->getOtherBindings(), |
||
| 29 | "other bindings are set" |
||
| 30 | ); |
||
| 31 | $this->assertEquals( |
||
| 32 | "value", |
||
| 33 | $field->getBindingType(), |
||
| 34 | "Binding Type is set" |
||
| 35 | ); |
||
| 36 | |||
| 37 | $field->setBindingType('textInput'); |
||
| 38 | $this->assertEquals( |
||
| 39 | "textInput", |
||
| 40 | $field->getBindingType(), |
||
| 41 | "Binding Type is reset" |
||
| 42 | ); |
||
| 43 | $this->assertTrue( |
||
| 44 | $field->getHasFocus(), |
||
| 45 | "Focus is set to True" |
||
| 46 | ); |
||
| 49 |