function it_wraps_client_exceptions_with_ours(MethodInterface $method, ClientInterface $client, RequestInterface $request, ExceptionMapper $mapper, ClientException $exception) { $client->send($request)->willThrow($exception->getWrappedObject()); $mapper->get($exception->getWrappedObject(), $method)->shouldBeCalled()->willThrow('Cardinity\\Exception\\Request'); $this->shouldThrow('Cardinity\\Exception\\Request')->duringSendRequest($method, 'POST', 'https://api.cardinity.com/v1/'); }