Skip to content

Commit

Permalink
Use once()
Browse files Browse the repository at this point in the history
  • Loading branch information
jsor committed Oct 12, 2015
1 parent 6c009a0 commit 4ccd0ee
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions tests/ClientTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ public function it_returns_raw_response()
$httpClient = $this->getMock(HttpClientInterface::class);

$httpClient
->expects($this->any())
->expects($this->once())
->method('send')
->will($this->returnValue($response));

Expand Down Expand Up @@ -244,7 +244,7 @@ public function it_throws_exception_when_http_client_throws()
$httpClient = $this->getMock(HttpClientInterface::class);

$httpClient
->expects($this->any())
->expects($this->once())
->method('send')
->will($this->throwException($exception));

Expand Down Expand Up @@ -273,7 +273,7 @@ public function it_throws_exception_when_http_client_returns_client_error()
$httpClient = $this->getMock(HttpClientInterface::class);

$httpClient
->expects($this->any())
->expects($this->once())
->method('send')
->will($this->returnValue(new Response(404, ['Content-Type' => 'application/hal+json'], '{"msg":"error"}')));

Expand Down Expand Up @@ -306,7 +306,7 @@ public function it_throws_exception_when_http_client_returns_server_error()
$httpClient = $this->getMock(HttpClientInterface::class);

$httpClient
->expects($this->any())
->expects($this->once())
->method('send')
->will($this->returnValue(new Response(500, ['Content-Type' => 'application/hal+json'], '{"msg":"error"}')));

Expand Down Expand Up @@ -339,7 +339,7 @@ public function it_throws_exception_when_http_client_returns_unsuccessful_respon
$httpClient = $this->getMock(HttpClientInterface::class);

$httpClient
->expects($this->any())
->expects($this->once())
->method('send')
->will($this->returnValue(new Response(303, ['Content-Type' => 'application/hal+json'], '{"msg":"error"}')));

Expand Down Expand Up @@ -372,7 +372,7 @@ public function it_throws_exception_for_invalid_content_type()
$httpClient = $this->getMock(HttpClientInterface::class);

$httpClient
->expects($this->any())
->expects($this->once())
->method('send')
->will($this->returnValue(new Response(200, ['Content-Type' => 'text/plain'])));

Expand Down Expand Up @@ -401,7 +401,7 @@ public function it_throws_exception_when_getting_response_body_throws()
$httpClient = $this->getMock(HttpClientInterface::class);

$httpClient
->expects($this->any())
->expects($this->once())
->method('send')
->will($this->returnValue(new Response(200, ['Content-Type' => 'application/hal+json'], $stream)));

Expand All @@ -423,7 +423,7 @@ public function it_throws_exception_when_http_client_returns_invalid_json()
$httpClient = $this->getMock(HttpClientInterface::class);

$httpClient
->expects($this->any())
->expects($this->once())
->method('send')
->will($this->returnValue(new Response(200, ['Content-Type' => 'application/hal+json'], '{')));

Expand Down

0 comments on commit 4ccd0ee

Please sign in to comment.