private function createEvent($token, $clientIp)
{
$this->request = $this->createMock('Symfony\\Component\\HttpFoundation\\Request');
$this->request->expects($this->any())->method('getClientIp')->willReturn($clientIp);
$event = $this->createMock('Symfony\\Component\\Security\\Http\\Event\\InteractiveLoginEvent');
$event->expects($this->any())->method('getRequest')->willReturn($this->request);
$event->expects($this->any())->method('getAuthenticationToken')->willReturn($token);
return $event;
}