onKernelResponse() public method

public onKernelResponse ( FilterResponseEvent $event )
$event Symfony\Component\HttpKernel\Event\FilterResponseEvent
 /**
  * @depends testToolbarIsInjected
  */
 public function testToolbarIsNotInjectedOnNonHtmlRequests()
 {
     $response = new Response('<html><head></head><body></body></html>');
     $response->headers->set('X-Debug-Token', 'xxxxxxxx');
     $event = new FilterResponseEvent($this->getKernelMock(), $this->getRequestMock(false, 'json'), HttpKernelInterface::MASTER_REQUEST, $response);
     $listener = new WebDebugToolbarListener($this->getTemplatingMock());
     $listener->onKernelResponse($event);
     $this->assertEquals('<html><head></head><body></body></html>', $response->getContent());
 }
 public function testThrowingUrlGenerator()
 {
     $response = new Response();
     $response->headers->set('X-Debug-Token', 'xxxxxxxx');
     $urlGenerator = $this->getUrlGeneratorMock();
     $urlGenerator->expects($this->once())->method('generate')->with('_profiler', array('token' => 'xxxxxxxx'))->will($this->throwException(new \Exception('foo')));
     $event = new FilterResponseEvent($this->getKernelMock(), $this->getRequestMock(), HttpKernelInterface::MASTER_REQUEST, $response);
     $listener = new WebDebugToolbarListener($this->getTwigMock(), false, WebDebugToolbarListener::ENABLED, 'bottom', $urlGenerator);
     $listener->onKernelResponse($event);
     $this->assertEquals('Exception: foo', $response->headers->get('X-Debug-Error'));
 }