/** * Get the response from the API endpoint * @param string $endpoint * @param array $options * @return Array */ public function getResponse($endpoint, $options = array()) { if ($this->client->getVersion() == 'v1') { $endpoint .= '.json'; } $options = array_merge_recursive($this->options, $options); $response = $this->get($endpoint, $options); // For tests we want the entire response object. if ($this->testing) { return $response; } return $response->json(); }
public function testVersion() { $this->assertEquals("v1", $this->instance->getVersion()); $instanceForV1 = new Client(array('version' => 'v2')); $this->assertEquals("v2", $instanceForV1->getVersion()); }