public function testAdditionalParameters() { $endPoint = $this->getMock('\\OAuth\\Common\\Http\\Uri\\UriInterface'); $endPoint->expects($this->any())->method('getHost')->will($this->returnValue('httpbin.org')); $endPoint->expects($this->any())->method('getAbsoluteUri')->will($this->returnValue('http://httpbin.org/gzip')); $client = new CurlClient(); $client->setCurlParameters(array(CURLOPT_ENCODING => 'gzip')); $response = $client->retrieveResponse($endPoint, '', array(), 'get'); $response = json_decode($response, true); $this->assertNotNull($response); $this->assertSame('gzip', $response['headers']['Accept-Encoding']); $this->assertTrue($response['gzipped']); }
/** * {@inheritdoc} */ public function retrieveResponse(UriInterface $endpoint, $requestBody, array $extraHeaders = [], $method = 'POST') { $this->setCurlParameters([CURLOPT_FAILONERROR => true]); return parent::retrieveResponse($endpoint, $requestBody, $extraHeaders, $method); }