public function testGetModelFails() { $request = $this->getMock('GuzzleHttp\\Message\\RequestInterface'); $response = $this->getMock('GuzzleHttp\\Message\\ResponseInterface'); $response->expects($this->once())->method('getBody')->willThrowException(new Exception()); $client = $this->getMock('GuzzleHttp\\ClientInterface', [], Requestor::getApiUrlOption('test')); $client->expects($this->once())->method('createRequest')->will($this->returnValue($request)); $client->expects($this->once())->method('send')->will($this->returnValue($response)); $requestor = new Requestor($client); $this->assertFalse($requestor->get('12345', ['id' => '54321'])); }