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); } }
/** * 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; }