public function testGetAndSetReason() { $request = new Response(); $request->setReason("I'M A LITTLE TEAPOT"); $this->assertEquals("I'M A LITTLE TEAPOT", $request->getReason()); }
private function inflateGzipBody(Response $response) { $src = $response->getBody(); if (is_resource($src)) { $destination = fopen('php://memory', 'r+'); fseek($src, 10, SEEK_SET); stream_filter_prepend($src, 'zlib.inflate', STREAM_FILTER_READ); stream_copy_to_stream($src, $destination); rewind($destination); $response->setBody($destination); } elseif (strlen($src)) { $body = gzdecode($src); $response->setBody($body); } }