public function testAuthenticate()
 {
     $auth = new Authentication(self::$config['username'], self::$config['apiKey'], self::$config['options']['authurl'], 'PHPUnit', self::$config['timeout']);
     $info = $auth->authenticate();
     $this->assertInternalType('array', $info);
     $this->assertCount(3, $info);
 }
예제 #2
0
 /**
  * Authenticate and setup this instance with the values returned.
  */
 protected function authenticate()
 {
     if (!$this->isAuthenticated) {
         list($url, $this->cdnUrl, $this->authToken) = $this->auth->authenticate();
         if ($this->useServicenet) {
             $url = str_replace('https://', 'https://snet-%s', $url);
         }
         $this->connectionUrlInfo = Utils::parseUrl($url);
         $this->httpConnect();
         if ($this->cdnUrl) {
             $this->cdnConnect();
         }
         $this->isAuthenticated = true;
     }
 }