/** * @dataProvider dataProvider * * @param UserInterface $user * @param bool $expected */ public function testOnSuccessLogin(UserInterface $user, $expected) { $this->token->expects($this->once())->method('getUser')->willReturn($user); $this->event->expects($this->once())->method('getAuthenticationToken')->willReturn($this->token); $this->event->expects($expected ? $this->once() : $this->never())->method('getRequest')->willReturn($this->request); $this->assertNull($this->request->attributes->get('_fullRedirect')); $this->listener->onSecurityInteractiveLogin($this->event); $this->assertEquals($expected, $this->request->attributes->get('_fullRedirect')); }