Exemplo n.º 1
0
 public function testRestArray()
 {
     $clients = Client::Rest(static::$credentials[0], static::$credentials[1], static::$services);
     foreach ($clients as $key => $client) {
         $matchingServiceName = static::$services[$key];
         $this->assertInstanceOf(RestClient::ns() . "\\{$matchingServiceName}", $client);
     }
 }
Exemplo n.º 2
0
 /**
  * Instantiate a REST service client
  *
  * @static
  * @param  string                   $username API Login
  * @param  string                   $password API Password
  * @param  string                   $service  Service name
  * @return CallFire\Api\Rest\Client REST API client
  */
 protected static function createRestClient($username, $password, $service)
 {
     $serviceClass = RestClient::ns() . "\\{$service}";
     $client = new $serviceClass();
     $client->setUsername($username);
     $client->setPassword($password);
     return $client;
 }