/** * @test */ public function itShouldCatchHttpClientExceptionsWhenCreatingAnOrder() { $this->httpClient->shouldReceive('post')->once()->andThrow(new HttpClientException('Something happened', m::mock('GuzzleHttp\\Message\\Request'))); $this->setExpectedException('GingerPayments\\Payment\\Client\\ClientException'); $this->client->createOrder(1234, 'EUR', 'credit-card'); }