public function _initialize() { $client = new \Behat\Mink\Driver\Goutte\Client(); $driver = new \Behat\Mink\Driver\GoutteDriver($client); $curl_config = array_merge($this->curl_defaults, $this->config['curl']); array_walk($curl_config, function ($a, &$b) { $b = "curl.{$b}"; }); $client->setClient($this->guzzle = new Client('', $curl_config)); $this->session = new \Behat\Mink\Session($driver); parent::_initialize(); }
public function _initialize() { $client = new \Behat\Mink\Driver\Goutte\Client(); $driver = new \Behat\Mink\Driver\GoutteDriver($client); // build up a Guzzle friendly list of configuration options // passed in both from our defaults and the respective // yaml configuration file (if applicable) $curl_config['curl.options'] = $this->curl_defaults; foreach ($this->config['curl'] as $key => $val) { if (defined($key)) { $curl_config['curl.options'][constant($key)] = $val; } } // Guzzle client requires that we set the ssl.certificate_authority config // directive if we wish to disable SSL verification if ($curl_config['curl.options'][CURLOPT_SSL_VERIFYPEER] !== true) { $curl_config['ssl.certificate_authority'] = false; } $client->setClient($this->guzzle = new Client('', $curl_config)); $this->session = new \Behat\Mink\Session($driver); parent::_initialize(); }