Beispiel #1
0
 public function test_that_get_request_returns_expected_instance()
 {
     $request = $this->mock(RequestInterface::class);
     $exception = new RequestException('Something went wrong', $request);
     $this->assertSame($request, $exception->getRequest());
 }
Beispiel #2
0
 /**
  * Constructs HttpException
  *
  * @param string            $message  The message
  * @param RequestInterface  $request  The request
  * @param ResponseInterface $response The response
  * @param \Exception|null   $previous The previous exception
  */
 public function __construct(string $message, RequestInterface $request, ResponseInterface $response, \Exception $previous = null)
 {
     $this->response = $response;
     parent::__construct($message, $request, $previous);
     $this->code = $response->getStatusCode();
 }