You can check the code inside the block catchusing the method addExceptionin the object GuzzleHttp\Subscriber\Mock.
This is a complete test:
public function testTimeOut()
{
$mock = new \GuzzleHttp\Subscriber\Mock();
$mock->addException(
new \GuzzleHttp\Exception\ConnectException(
'Time Out',
new \GuzzleHttp\Message\Request('post', '/')
)
);
$this->httpClient
->getEmitter()
->attach($mock);
$this->client = new Client($this->config, $this->routing, $this->httpClient);
$this->client->request('any_route');
}
unit test GuzzleHttp\Exception\ConnectException . , , , , request.
:
Mockito test void