diff --git a/src/V2/Endpoint.php b/src/V2/Endpoint.php index 0860ecb..3ec5a47 100644 --- a/src/V2/Endpoint.php +++ b/src/V2/Endpoint.php @@ -77,6 +77,7 @@ public function getSchema() { * @param string $method * @param array $options * @return ApiResponse + * @throws ApiException|GuzzleException */ protected function request( array $query = [], $url = null, $method = 'GET', $options = [] ) { $request = $this->createRequest( $query, $url, $method, $options ); diff --git a/tests/ApiExceptionTest.php b/tests/ApiExceptionTest.php index d6397ff..95f0189 100644 --- a/tests/ApiExceptionTest.php +++ b/tests/ApiExceptionTest.php @@ -1,6 +1,6 @@ expectException(\GuzzleHttp\Exception\ConnectException::class, 'RequestExceptionWithoutResponse'); + $this->expectException(RequestException::class, 'RequestExceptionWithoutResponse'); $this->mockResponse( - new ConnectException('RequestExceptionWithoutResponse', new Request('GET', 'test/exception')) + new RequestException('RequestExceptionWithoutResponse', new Request('GET', 'test/exception')) ); $this->getEndpoint()->test(); @@ -75,14 +75,14 @@ public function testRequestExceptionWithoutResponse() { /** */ public function testRequestManyExceptionWithoutResponse() { - $this->expectException(\GuzzleHttp\Exception\ConnectException::class, 'RequestManyExceptionWithoutResponse'); + $this->expectException(RequestException::class, 'RequestManyExceptionWithoutResponse'); $this->mockResponse( new Response( 200, [ 'X-Result-Total' => 10, 'Content-Type' => 'application/json; charset=utf-8' ], Utils::streamFor( '[1,2,3]' ) )); $this->mockResponse( - new ConnectException('RequestManyExceptionWithoutResponse', new Request('GET', 'test/exception')) + new RequestException('RequestManyExceptionWithoutResponse', new Request('GET', 'test/exception')) ); $this->getEndpoint()->testMany(2);