protected function mockClient() { $mockResponse = new \Guzzle\Http\Message\Response(200); $mockResponse->setBody('{"hello":"world","0":[{"alpha":null},{"gamma":3}],"1":{"echo":"foxtrot","\\"quote\\"":true}}', 'application/json'); $mockResponse->setHeaders(array('Host' => 'ms-lib-testrest', 'User-Agent' => 'test', 'Accept' => 'application/json', 'Content-Type' => 'application/json', 'Location' => 'hello')); $plugin = new \Guzzle\Plugin\Mock\MockPlugin(); $plugin->addResponse($mockResponse); $client = new \Guzzle\Service\Client(); $client->setDefaultOption('exceptions', false); $client->addSubscriber($plugin); $this->setPropertyValue('client', $client); $this->setPropertyValue('response', $mockResponse); }