public function testHandleWhenControllerThrowsAnExceptionAndRawIsFalse() {
$dispatcher = new EventDispatcher();
$dispatcher
->addListener(KernelEvents::EXCEPTION, function ($event) {
$event
->setResponse(new Response($event
->getException()
->getMessage()));
});
$kernel = new HttpKernel($dispatcher, $this
->getResolver(function () {
throw new \RuntimeException('foo');
}));
$response = $kernel
->handle(new Request());
$this
->assertEquals('500', $response
->getStatusCode());
$this
->assertEquals('foo', $response
->getContent());
}