public function testCreateWithAdapterOptions() { $capath = '/some/path'; $maxRedirs = 4; $client = $this->_factory->createHttpClient(array('options' => array(HttpClientFactory::OPT_CAPATH => $capath), 'curl_adapter_options' => array(CURLOPT_MAXREDIRS => $maxRedirs))); $adapterConfig = $client->getAdapter()->getConfig(); $this->assertSame($maxRedirs, $adapterConfig['curloptions'][CURLOPT_MAXREDIRS]); }
/** * Creates and returns the HTTP client based on the provided configuration. * * @param array $config * @return Http\Client */ protected function _createHttpClient(array $config) { $httpClientFactory = new HttpClientFactory(); $client = $httpClientFactory->createHttpClient($config); return $client; }