/** * Test to ensure that if a Request Exception is thrown that client rethrows it * * @expectedException \Exception */ public function testEnsureSendExceptionIsRethrown() { $request = $this->getMockBuilder('\\GuzzleHttp\\Message\\Request')->disableOriginalConstructor()->getMock(); $this->mockClient->expects($this->once())->method('send')->with($request)->will($this->throwException(new \Exception())); $client = new Client(); $client->setHttpClient($this->mockClient); $client->send($request); }