/** * Tests the getResponse() method. */ public function testGetResponse() { $exception = new ResponseException(new Response('Hello world')); $this->assertInstanceOf('Symfony\\Component\\HttpFoundation\\Response', $exception->getResponse()); $this->assertEquals(200, $exception->getResponse()->getStatusCode()); $this->assertEquals('Hello world', $exception->getResponse()->getContent()); }
/** * Constructor. * * @param string $location * @param int $status * @param \Exception|null $previous */ public function __construct($location, $status = 302, \Exception $previous = null) { parent::__construct(new Response($location, $status, ['X-Ajax-Location' => $location]), $previous); }
/** * Constructor. * * @param \Exception|null $previous */ public function __construct(\Exception $previous = null) { parent::__construct(new Response('', 204), $previous); }
/** * Constructor. * * @param string $location * @param int $status * @param \Exception|null $previous */ public function __construct($location, $status = 303, \Exception $previous = null) { parent::__construct(new RedirectResponse($location, $status), $previous); }