public function testInvalidView()
{
/** @var HttpKernelInterface $kernel */
$kernel = $this->getMockForAbstractClass('Symfony\\Component\\HttpKernel\\Kernel', ['test', false]);
$request = new Request(['toggle_view' => 'foobar']);
$request->attributes->set('_route', 'dummy');
$request->attributes->set('_scope', ContaoCoreBundle::SCOPE_FRONTEND);
$event = new GetResponseEvent($kernel, $request, HttpKernelInterface::MASTER_REQUEST);
$listener = new ToggleViewListener($this->framework);
$listener->setContainer($this->mockContainerWithContaoScopes(ContaoCoreBundle::SCOPE_FRONTEND));
$listener->onKernelRequest($event);
$this->assertTrue($event->hasResponse());
$this->assertCookieValue($event->getResponse(), 'desktop');
}