Conditions | 1 |
Paths | 1 |
Total Lines | 16 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
15 | public function testListener() |
||
16 | { |
||
17 | $logger = $this->createMock(AbstractLogger::class); |
||
18 | $version = $this->createMock(VersionChecker::class); |
||
19 | $token = $this->createMock(TokenInterface::class); |
||
20 | $user = $this->createMock(User::class); |
||
21 | $event = $this->createMock(InteractiveLoginEvent::class); |
||
22 | |||
23 | $logger->expects($this->once())->method('info')->willReturn(true); |
||
24 | $version->expects($this->once())->method('periodicallyCheck')->willReturn(true); |
||
25 | $event->expects($this->once())->method('getAuthenticationToken')->willReturn($token); |
||
26 | $token->expects($this->once())->method('getUser')->willReturn($user); |
||
27 | |||
28 | $listener = new LoginListener($logger, $version); |
||
29 | $listener->onSecurityInteractiveLogin($event); |
||
30 | } |
||
31 | } |
||
32 |
It seems like the type of the argument is not accepted by the function/method which you are calling.
In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.
We suggest to add an explicit type cast like in the following example: