/**
  * @expectedException \GuzzleHttp\Exception\AdapterException
  * @expectedExceptionMessage cURL error -2:
  */
 public function testChecksCurlMultiResult()
 {
     MultiAdapter::throwMultiError(-2);
 }
 /**
  * Remove a transaction and associated handle from the context
  *
  * @param TransactionInterface $transaction Transaction to remove
  *
  * @return array Returns the curl_getinfo array
  * @throws AdapterException if the transaction is not found
  */
 public function removeTransaction(TransactionInterface $transaction)
 {
     if (!isset($this->handles[$transaction])) {
         throw new AdapterException('Transaction not registered');
     }
     $handle = $this->handles[$transaction];
     $this->handles->detach($transaction);
     $info = curl_getinfo($handle);
     $code = curl_multi_remove_handle($this->multi, $handle);
     curl_close($handle);
     if ($code !== CURLM_OK) {
         MultiAdapter::throwMultiError($code);
     }
     return $info;
 }