Conditions | 1 |
Paths | 1 |
Total Lines | 11 |
Code Lines | 8 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
13 | public function testValidate(): void |
||
14 | { |
||
15 | $rule = new MatchRegularExpression('/^[a-zA-Z0-9](\.)?([^\/]*)$/m'); |
||
16 | $this->assertTrue($rule->validate('b.4')->isValid()); |
||
17 | $this->assertFalse($rule->validate('b./')->isValid()); |
||
18 | $this->assertFalse($rule->validate(['a', 'b'])->isValid()); |
||
19 | |||
20 | $rule = (new MatchRegularExpression('/^[a-zA-Z0-9](\.)?([^\/]*)$/m'))->not(); |
||
21 | $this->assertFalse($rule->validate('b.4')->isValid()); |
||
22 | $this->assertTrue($rule->validate('b./')->isValid()); |
||
23 | $this->assertFalse($rule->validate(['a', 'b'])->isValid()); |
||
24 | } |
||
26 |