/** * @return GuzzleClient */ public function getApiClient() { if ($this->apiClient === null) { $this->apiClient = $this->clientFactory->createApiClient($this->apiKey); } return $this->apiClient; }
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'); }