Conditions | 1 |
Paths | 1 |
Total Lines | 20 |
Code Lines | 11 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
24 | public function testAllow(): void |
||
25 | { |
||
26 | /** @var ActorInterface $actor */ |
||
27 | $actor = $this->createMock(ActorInterface::class); |
||
28 | $context = []; |
||
29 | |||
30 | /** @var \PHPUnit_Framework_MockObject_MockObject|callable $callable */ |
||
31 | $callable = $this->getMockBuilder(\stdClass::class) |
||
|
|||
32 | ->setMethods(['__invoke']) |
||
33 | ->getMock(); |
||
34 | |||
35 | $callable->method('__invoke') |
||
36 | ->with($actor, static::OPERATION, $context) |
||
37 | ->willReturn(true, false); |
||
38 | |||
39 | /** @var RuleInterface $rule */ |
||
40 | $rule = new CallableRule($callable); |
||
41 | |||
42 | $this->assertTrue($rule->allows($actor, static::OPERATION, $context)); |
||
43 | $this->assertFalse($rule->allows($actor, static::OPERATION, $context)); |
||
44 | } |
||
46 |
This function has been deprecated. The supplier of the function has supplied an explanatory message.
The explanatory message should give you some clue as to whether and when the function will be removed and what other function to use instead.