| Conditions | 1 |
| Total Lines | 18 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 18 | private function testGetOptionsWithNotRuleInternal($ruleClassName): void |
||
| 19 | { |
||
| 20 | $rule = new $ruleClassName([ |
||
| 21 | new Required(), |
||
| 22 | new class () { |
||
| 23 | }, |
||
| 24 | new Number(min: 1), |
||
| 25 | ]); |
||
| 26 | $this->assertInstanceOf(RuleWithOptionsInterface::class, $rule); |
||
|
|
|||
| 27 | $this->assertInstanceOf(RulesProviderInterface::class, $rule); |
||
| 28 | |||
| 29 | $this->expectException(InvalidArgumentException::class); |
||
| 30 | |||
| 31 | $ruleInterfaceName = RuleInterface::class; |
||
| 32 | $message = "Rule must be either an instance of $ruleInterfaceName or a callable, class@anonymous given."; |
||
| 33 | $this->expectExceptionMessage($message); |
||
| 34 | |||
| 35 | $rule->getOptions(); |
||
| 36 | } |
||
| 38 |