public function getQueryClientResponseMock($body, $command, $responseCode = null)
{
$response = $this->getMock(self::CLOUDSTACK_NS . '\\Client\\QueryClientResponse', array('getContent', 'getResponseCode'), array($this->getMock('\\http\\Client\\Response'), $command));
if ($responseCode === null) {
if (preg_match('/errorresponse/i', $body)) {
$responseCode = 500;
} else {
$responseCode = 200;
}
}
$response->expects($this->any())->method('getResponseCode')->will($this->returnValue($responseCode));
$response->expects($this->any())->method('getContent')->will($this->returnValue($body));
return $response;
}