public function testOnKernelRequestAccessDenied()
{
$this->setExpectedException('eZ\\Publish\\Core\\MVC\\Symfony\\Security\\Exception\\UnauthorizedSiteAccessException');
$request = new Request();
$request->attributes->set('siteaccess', new SiteAccess());
$event = new GetResponseEvent($this->getMock('Symfony\\Component\\HttpKernel\\HttpKernelInterface'), $request, HttpKernelInterface::MASTER_REQUEST);
$token = $this->getMock('Symfony\\Component\\Security\\Core\\Authentication\\Token\\TokenInterface');
$token->expects($this->any())->method('getUsername')->will($this->returnValue('foo'));
$this->tokenStorage->expects($this->once())->method('getToken')->will($this->returnValue($token));
$this->authChecker->expects($this->once())->method('isGranted')->will($this->returnValue(false));
$this->listener->onKernelRequest($event);
}