Пример #1
0
 /**
  * @covers Guzzle\Http\Message\Request::setResponse
  * @covers Guzzle\Http\Message\Request::getResponse
  * @covers Guzzle\Http\Message\Request::getState
  */
 public function testSetManualResponse()
 {
     $response = new Response(200, array('Date' => 'Sat, 16 Oct 2010 17:27:14 GMT', 'Expires' => '-1', 'Cache-Control' => 'private, max-age=0', 'Content-Type' => 'text/html; charset=ISO-8859-1'), 'response body');
     $this->assertSame($this->request, $this->request->setResponse($response), '-> setResponse() must use a fluent interface');
     $this->assertEquals('complete', $this->request->getState(), '-> setResponse() must change the state of the request to complete');
     $this->assertSame($response, $this->request->getResponse(), '-> setResponse() must set the exact same response that was passed in to it');
 }