| Total Complexity | 3 |
| Total Lines | 31 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 8 | class EditableNumericFieldTest extends SapphireTest |
||
| 9 | { |
||
| 10 | public function testAllowEmptyTitle() |
||
| 16 | } |
||
| 17 | |||
| 18 | public function testValidateAddsErrorWhenMinValueIsGreaterThanMaxValue() |
||
| 19 | { |
||
| 20 | /** @var EditableNumericField $field */ |
||
| 21 | $field = EditableNumericField::create(); |
||
| 22 | $field->MinValue = 10; |
||
|
|
|||
| 23 | $field->MaxValue = 5; |
||
| 24 | |||
| 25 | $result = $field->validate(); |
||
| 26 | $this->assertFalse($result->isValid(), 'Validation should fail when min is greater than max'); |
||
| 27 | $this->assertContains('Minimum length should be less than the maximum length', $result->serialize()); |
||
| 28 | } |
||
| 29 | |||
| 30 | public function testValidate() |
||
| 39 | } |
||
| 40 | } |
||
| 41 |