/** * @return GuzzleClient */ public function getUploadClient() { if ($this->uploadClient === null) { $this->uploadClient = $this->clientFactory->createUploadClient($this->apiKey); } return $this->uploadClient; }
public function testDefaultHeadersForUploadClient() { $apiKey = 'fooBar'; $factory = new BoxClient\ClientFactory(); $headers = $factory->createUploadClient($apiKey)->getConfig('headers'); $this->assertEquals($headers['Authorization'], 'Token ' . $apiKey); $this->assertEquals($headers['Content-Type'], 'multipart/form-data'); }