argumentMap = $argumentMap; } /** * Do a GET request to retrieve the contents of a remote URL. * * @param string $url URL to get. * @return Response Response for the executed request. * @throws FailedRemoteRequest If retrieving the contents from the URL failed. */ public function get($url) { if (! array_key_exists($url, $this->argumentMap)) { throw new LogicException("Trying to stub a remote request for an unknown URL: {$url}."); } return new RemoteGetRequestResponse($this->argumentMap[$url]); } }