Skip to content

Commit f49dc7c

Browse files
authored
Merge pull request #213 from Soullivaneuh/last-elements
Last elements getters for mock client
2 parents 9a7df07 + 4bf8de8 commit f49dc7c

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

clients/mock-client.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,10 +56,12 @@ certain responses::
5656

5757
$response = $this->getMock('Psr\Http\Message\ResponseInterface');
5858
$client->addResponse($response);
59+
$this->assertSame($response, $client->getLastResponse());
5960

6061
// $request is an instance of Psr\Http\Message\RequestInterface
6162
$returnedResponse = $client->sendRequest($request);
6263
$this->assertSame($response, $returnedResponse);
64+
$this->assertSame($request, $client->getLastRequest());
6365
}
6466
}
6567

@@ -78,6 +80,7 @@ To fake an exception being thrown::
7880

7981
$exception = new \Exception('Whoops!');
8082
$client->addException($exception);
83+
$this->assertSame($exception, $client->getLastException());
8184

8285
// $request is an instance of Psr\Http\Message\RequestInterface
8386
$returnedResponse = $client->sendRequest($request);

0 commit comments

Comments
 (0)