public function testCreatePayoutWithException()
{
$response = $this->getMockResponse();
$response->method('getBody')->willReturn('{"error":"Error with request"}');
$adapter = $this->getMockAdapter();
$adapter->method('sendRequest')->willReturn($response);
$this->client->setAdapter($adapter);
$currency = $this->getMockCurrency();
$currency->method('getCode')->will($this->returnValue('USD'));
$token = $this->getMockToken();
$payout = new \Bitpay\Payout();
$payout->setCurrency($currency)->setEffectiveDate("1415853007000")->setPricingMethod('bitcoinbestbuy')->setToken($token);
$this->client->createPayout($payout);
}