function it_returns_response_on_render(HandlerInterface $handler1, HandlerInterface $handler2, Exception $exception) { $handler1->handle($exception)->will(function () { echo 'world!'; return Handler::DONE; }); $handler2->handle($exception)->will(function () { echo 'Hello '; return Handler::DONE; }); $this->pushHandler($handler1); $this->pushHandler($handler2); $response = $this->render($exception); $response->shouldBeAnInstanceOf('Symfony\\Component\\HttpFoundation\\Response'); $response->getContent()->shouldReturn('Hello world!'); }
function it_stops_handling_on_quit_response(HandlerInterface $handlerDone, HandlerInterface $handlerQuit, Exception $exception) { // Disable actual quit, otherwise test suite exits as well $this->isAllowedToQuit(false); $handlerDone->handle($exception)->shouldNotBeCalled(); $handlerQuit->handle($exception)->will(function () { return Handler::QUIT; }); $this->pushHandler($handlerDone); $this->pushHandler($handlerQuit); $this->handleException($exception); }