Skip to content

Commit adbc885

Browse files
sagikazarmarkdbu
authored andcommitted
Move Body, HttpError exceptions, BatchRequest, HttpMethods to utility
1 parent 2169fc0 commit adbc885

21 files changed

+27
-868
lines changed

spec/Body/CombinedMultipartSpec.php

Lines changed: 0 additions & 44 deletions
This file was deleted.

spec/Body/FilesSpec.php

Lines changed: 0 additions & 44 deletions
This file was deleted.

spec/Body/MultipartDataSpec.php

Lines changed: 0 additions & 40 deletions
This file was deleted.

spec/Body/UrlencodedDataSpec.php

Lines changed: 0 additions & 33 deletions
This file was deleted.

spec/Exception/ClientExceptionSpec.php

Lines changed: 0 additions & 27 deletions
This file was deleted.

spec/Exception/HttpExceptionSpec.php

Lines changed: 1 addition & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -30,32 +30,6 @@ function it_has_a_response(ResponseInterface $response)
3030
$this->getResponse()->shouldReturn($response);
3131
}
3232

33-
function it_creates_a_client_exception(RequestInterface $request, ResponseInterface $response)
34-
{
35-
$request->getRequestTarget()->willReturn('/uri');
36-
$request->getMethod()->willReturn('GET');
37-
$response->getStatusCode()->willReturn(404);
38-
$response->getReasonPhrase()->willReturn('Not Found');
39-
40-
$e = $this->create($request, $response);
41-
42-
$e->shouldHaveType('Http\Client\Exception\ClientException');
43-
$e->getMessage()->shouldReturn('Client error [url] /uri [http method] GET [status code] 404 [reason phrase] Not Found');
44-
}
45-
46-
function it_creates_a_server_exception(RequestInterface $request, ResponseInterface $response)
47-
{
48-
$request->getRequestTarget()->willReturn('/uri');
49-
$request->getMethod()->willReturn('GET');
50-
$response->getStatusCode()->willReturn(500);
51-
$response->getReasonPhrase()->willReturn('Internal Server Error');
52-
53-
$e = $this->create($request, $response);
54-
55-
$e->shouldHaveType('Http\Client\Exception\ServerException');
56-
$e->getMessage()->shouldReturn('Server error [url] /uri [http method] GET [status code] 500 [reason phrase] Internal Server Error');
57-
}
58-
5933
function it_creates_an_http_exception(RequestInterface $request, ResponseInterface $response)
6034
{
6135
$request->getRequestTarget()->willReturn('/uri');
@@ -66,6 +40,6 @@ function it_creates_an_http_exception(RequestInterface $request, ResponseInterfa
6640
$e = $this->create($request, $response);
6741

6842
$e->shouldHaveType('Http\Client\Exception\HttpException');
69-
$e->getMessage()->shouldReturn('Unsuccessful response [url] /uri [http method] GET [status code] 100 [reason phrase] Continue');
43+
$e->getMessage()->shouldReturn('[url] /uri [http method] GET [status code] 100 [reason phrase] Continue');
7044
}
7145
}

spec/Exception/ServerExceptionSpec.php

Lines changed: 0 additions & 27 deletions
This file was deleted.

spec/HttpMethodsSpec.php

Lines changed: 0 additions & 101 deletions
This file was deleted.

0 commit comments

Comments
 (0)