public function testListenerSkipIfNoUserOnKernelRequest(AnonymousToken $noUserReturn = null)
{
$responseEvent = new GetResponseEvent($this->mockKernel(), new Request(), HttpKernelInterface::MASTER_REQUEST);
$session = $this->getMock('Symfony\\Component\\HttpFoundation\\Session\\SessionInterface');
$session->expects($this->never())->method('getBag');
$tokenStorage = $this->getMock('Symfony\\Component\\Security\\Core\\Authentication\\Token\\Storage\\TokenStorageInterface');
$tokenStorage->expects($this->once())->method('getToken')->willReturn($noUserReturn);
$listener = $this->getListener($session, null, $tokenStorage);
$listener->setContainer($this->mockContainerWithContaoScopes(ContaoCoreBundle::SCOPE_BACKEND));
$listener->onKernelRequest($responseEvent);
}