public function setResponse($response) { if ($response instanceof Aspamia_Http_Response) { $this->_response = $response; } else { $this->_response = Aspamia_Http_Response::fromString($response); } }
/** * Test that we can convert a request object back to a string * * @param string $requestFile * @param integer $code * @param string $xtest * @param string $body * @dataProvider responseTestFileProvider */ public function testToString($requestFile, $code, $xtest, $body) { $str = file_get_contents(dirname(__FILE__) . '/_files/' . $requestFile); $response = Aspamia_Http_Response::fromString($str); $this->assertEquals($str, (string) $response); }