| Conditions | 1 |
| Paths | 1 |
| Total Lines | 16 |
| Code Lines | 12 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 17 | public function test_is_true() |
||
| 18 | { |
||
| 19 | $firstname = 'harry'; |
||
| 20 | $lastname = ''; |
||
| 21 | $field = new Field('name'); |
||
| 22 | $field->isTrue($firstname !== '', 'firstname required') |
||
| 23 | ->isTrue($lastname !== '', 'lastname required') |
||
| 24 | ->isTrue(strlen($firstname . ' ' . $lastname) > 10, 'fullname length must be greater than 10'); |
||
| 25 | |||
| 26 | $this->assertFalse($field->isValid($this->language)); |
||
| 27 | $this->assertEquals([ |
||
| 28 | 'lastname required', |
||
| 29 | 'fullname length must be greater than 10' |
||
| 30 | ], $field->getErrors()); |
||
| 31 | |||
| 32 | } |
||
| 33 | |||
| 50 |