public function testDeletePayoutWithException()
{
// Setup using getPayout
$response = $this->getMockResponse();
$response->method('getBody')->willReturn(file_get_contents(__DIR__ . '/../../DataFixtures/payouts/7m7hSF3ws1LhnWUf17CXsJ.json'));
$adapter = $this->getMockAdapter();
$adapter->method('sendRequest')->willReturn($response);
$this->client->setAdapter($adapter);
$payout = $this->client->getPayout('7m7hSF3ws1LhnWUf17CXsJ');
// Test with exception
$response = $this->getMockResponse();
$response->method('getBody')->willReturn('{"error":"Object not found"}');
$adapter = $this->getMockAdapter();
$adapter->method('sendRequest')->willReturn($response);
$this->client->setAdapter($adapter);
$payout = $this->client->deletePayout($payout);
$this->assertSame($payout->getStatus(), \Bitpay\Payout::STATUS_CANCELLED);
}