| Total Complexity | 3 |
| Total Lines | 32 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 9 | class RangeTest extends ConfiguredConstraintTestCase |
||
| 10 | { |
||
| 11 | public function testEmptyConfiguration(): void |
||
| 12 | { |
||
| 13 | $this->expectException(MissingOptionsException::class); |
||
| 14 | |||
| 15 | new ParsleyAssert\Range(); |
||
| 16 | } |
||
| 17 | |||
| 18 | public function testInvalidConfiguration(): void |
||
| 19 | { |
||
| 20 | $this->expectException(InvalidOptionsException::class); |
||
| 21 | |||
| 22 | new ParsleyAssert\Range([ |
||
| 23 | 'min' => '5', |
||
| 24 | 'max' => '10', |
||
| 25 | ]); |
||
| 26 | } |
||
| 27 | |||
| 28 | public function testNormalization(): void |
||
| 29 | { |
||
| 30 | $constraint = new ParsleyAssert\Range([ |
||
| 31 | 'min' => 5, |
||
| 32 | 'max' => 10, |
||
| 33 | ]); |
||
| 34 | |||
| 35 | $this->assertSame([ |
||
| 36 | 'data-parsley-min' => '5', |
||
| 37 | 'data-parsley-min-message' => 'Invalid.', |
||
| 38 | 'data-parsley-max' => '10', |
||
| 39 | 'data-parsley-max-message' => 'Invalid.', |
||
| 40 | ], $constraint->normalize($this->normalizer)); |
||
| 41 | } |
||
| 43 |