/** * Retrieves a resource information. * * @param string $resource The name of the resource. Should be a key in $resources. * @return array * @throws InvalidArgumentException If the requested resource is not in the list of valid ones. */ public function get($resource) { if (!isset($this->resources[$resource])) { throw new InvalidArgumentException('The requested resource is not in the list'); } return ResponseMediator::getContent($this->client->get($this->resources[$resource])); }
/** * @test */ public function shouldDoGETRequest() { $path = '/some/path'; $parameters = array('a' => 'b'); $headers = array('c' => 'd'); $client = $this->getBrowserMock(); $httpClient = new HttpClient(array(), $client); $httpClient->get($path, $parameters, $headers); }