| 1 | <?php |
||
| 9 | class RuleChainTest extends TestCase |
||
| 10 | { |
||
| 11 | public function test_it_can_validate_rules() |
||
| 12 | { |
||
| 13 | $rule = $this->createMock(Rule::class); |
||
| 14 | |||
| 15 | $rule->expects($this->once()) |
||
| 16 | ->method('__invoke'); |
||
| 17 | |||
| 18 | $validate = new RuleChain($rule); |
||
| 19 | |||
| 20 | $validate('password'); |
||
| 21 | } |
||
| 22 | |||
| 23 | public function test_it_can_validate_callables() |
||
| 24 | { |
||
| 25 | $function = function() {}; |
||
| 26 | |||
| 27 | $customMethod = new FixtureCustomMethod; |
||
| 28 | |||
| 29 | $rule = $this->createMock(Rule::class); |
||
| 30 | |||
| 31 | $rule->expects($this->once()) |
||
| 32 | ->method('__invoke'); |
||
| 51 |