Example #1
0
 /**
  * Conoha constructor.
  *
  * $data is your ConoHa API account information.
  *
  * For example,
  * $data = array(
  *  'username' => Your API Username,
  *  'password' => Your API Password,
  *  'tenantId' => Your API TenantID,
  *  'token' => Your API Token,
  *  'cookies' => [
  *      'isStoreTokenCookie' => true or false,
  *      'storeTokenCookieName' => Cookie Name
  *  ]
  * );
  *
  * If it not contain 'token', this class create and set token automatically.
  * If it not contain 'username' or 'password' (or both data), You can connect API,
  * but this class cannot refresh token.
  *
  * @param array $data
  */
 public function __construct($data = array())
 {
     $this->data = $data;
     if (!isset($data['cookies'])) {
         $this->data['cookies'] = array();
     }
     $token = new ConohaAPI\Common\DataStore\Token($this);
     $token->initToken();
 }
Example #2
0
 public function testSetToken()
 {
     $this->assertNull($this->token->setToken('new token'));
 }