Пример #1
0
 /**
  * @return GuzzleClient
  */
 public function getApiClient()
 {
     if ($this->apiClient === null) {
         $this->apiClient = $this->clientFactory->createApiClient($this->apiKey);
     }
     return $this->apiClient;
 }
Пример #2
0
 public function testDefaultHeadersForApiClient()
 {
     $apiKey = 'fooBar';
     $factory = new BoxClient\ClientFactory();
     $headers = $factory->createApiClient($apiKey)->getConfig('headers');
     $this->assertEquals($headers['Authorization'], 'Token ' . $apiKey);
     $this->assertEquals($headers['Content-Type'], 'application/json');
 }