public function getQueryClientResponseMock($body, $responseCode = null, $awsStub = null)
{
$response = $this->getMock(AwsTestCase::AWS_NS . '\\Client\\QueryClientResponse', array('getRawContent', 'getResponseCode'), array($this->getMock('\\http\\Client\\Response')));
if ($awsStub !== null) {
$response->setQueryNumber(++$awsStub->queriesQuantity);
}
if ($responseCode === null) {
if (preg_match('/<\\/errors>/i', $body)) {
$responseCode = 500;
} else {
$responseCode = 200;
}
}
$response->expects($this->any())->method('getResponseCode')->will($this->returnValue($responseCode));
$response->expects($this->any())->method('getRawContent')->will($this->returnValue($body));
return $response;
}