コード例 #1
0
 /**
  * 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();
 }
コード例 #2
0
 public function testResponseIsArray()
 {
     $instance = new Client();
     $response = $instance->api('build')->build();
     $this->assertTrue(is_array($response));
 }