Ejemplo n.º 1
0
 /**
  * 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;
 }
Ejemplo n.º 2
0
 public function testApiCallWithNoApiKeyThrowsException()
 {
     $this->setExpectedException('Dyn\\MessageManagement\\Api\\Exception\\MissingOrInvalidApiKeyException');
     $client = new Client();
     $client->get('/foo');
 }