Behat: Goutte/Guzzle downloading file via cURL "Warning: curl_setopt_array(): 3607 is not a valid File-Handle resource" Behat: Goutte/Guzzle downloading file via cURL "Warning: curl_setopt_array(): 3607 is not a valid File-Handle resource" curl curl

Behat: Goutte/Guzzle downloading file via cURL "Warning: curl_setopt_array(): 3607 is not a valid File-Handle resource"


I removed the part that was setting the curl opt file, and instead just read the content of the response into the file handle.

//Where to put the file$tmpFile = 'download.zip';$handle  = fopen($tmpFile, 'w');$goutteDriver = $this->getSession()->getDriver();$goutteClient = $goutteDriver->getClient();/** @var \Guzzle\Http\Client $guzzleClient */$guzzleClient = $goutteClient->getClient();//Remove this//$guzzleClient->getConfig()->set('curl.options', [CURLOPT_FILE => $handle]);$guzzleClient->setSslVerification(false);$goutteDriver->visit($url);//Add thisfwrite($handle, $goutteDriver->getContent());fclose($handle); 

And now everything works perfectly.