1
0
mirror of https://github.com/guzzle/guzzle.git synced 2025-02-25 10:33:18 +01:00

Merge pull request #653 from hpatoio/patch-1

Fixed a typo and updated name for 2 methods
This commit is contained in:
Jeremy Lindblom 2014-04-29 08:44:10 -07:00
commit be50b10d51

View File

@ -32,16 +32,16 @@ remote API.
// Create a mock subscriber and queue two responses. // Create a mock subscriber and queue two responses.
$mock = new Mock([ $mock = new Mock([
new Response(200, ['X-Foo' => 'Bar']), // Use response object new Response(200, ['X-Foo' => 'Bar']), // Use response object
"HTTP/1.1 202 OKr\nContent-Length: 0\r\n\r\n" // Use a response string "HTTP/1.1 202 OK\r\nContent-Length: 0\r\n\r\n" // Use a response string
]); ]);
// Add the mock subscriber to the client. // Add the mock subscriber to the client.
$client->getEmitter()->attach($mock); $client->getEmitter()->attach($mock);
// The first request is intercepted with the first response. // The first request is intercepted with the first response.
echo $client->get('/')->getStatus(); echo $client->get('/')->getStatusCode();
//> 200 //> 200
// The second request is intercepted with the second response. // The second request is intercepted with the second response.
echo $client->get('/')->getStatus(); echo $client->get('/')->getStatusCode();
//> 202 //> 202
When no more responses are in the queue and a request is sent, an When no more responses are in the queue and a request is sent, an