| Conditions | 1 |
| Paths | 1 |
| Total Lines | 23 |
| Code Lines | 17 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 2 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 13 | public function testKnockoutTextField() |
||
| 14 | { |
||
| 15 | $field = KnockoutTextField::create("MyField", "My Field", null, 50) |
||
| 16 | ->setObservable('spaceship') |
||
| 17 | ->setHasFocus(true); |
||
| 18 | |||
| 19 | $this->assertEquals( |
||
| 20 | "spaceship", |
||
| 21 | $field->getObservable(), |
||
| 22 | "observable is set" |
||
| 23 | ); |
||
| 24 | $this->assertEquals( |
||
| 25 | "textInput", |
||
| 26 | $field->getBindingType(), |
||
| 27 | "Binding Type is set" |
||
| 28 | ); |
||
| 29 | $this->assertTrue( |
||
| 30 | $field->getHasFocus(), |
||
| 31 | "Focus is set to True" |
||
| 32 | ); |
||
| 33 | $this->assertStringContainsString( |
||
| 34 | '<input data-bind="textInput: spaceship, hasFocus: true"', |
||
| 35 | $field->Field()->getValue() |
||
| 36 | ); |
||
| 39 |