/** * Returns an instance of the API client, creating it if required * * If a custom instance of the Zend Http Client was supplied to this class' * constructor it will be used. This allows for custom functionality (such as * working through a HTTP proxy) if needed. * * @return ApiClient */ public function getApiClient() { if (!$this->apiClient) { $this->apiClient = new ApiClient($this->httpClient); $this->apiClient->setApiKey($this->apiKey); } return $this->apiClient; }
public function testApiCallWithNoApiKeyThrowsException() { $this->setExpectedException('Dyn\\MessageManagement\\Api\\Exception\\MissingOrInvalidApiKeyException'); $client = new Client(); $client->get('/foo'); }