/** * Generate token. * * @return string * @throws \Exception */ private function generateToken() { $username = $this->client->getUsername(); $password = $this->client->getUserPassword(); if ($username === null || $password === null) { throw new \Exception('Cannot refresh token.'); } return $this->client->identityService()->getToken()->access->token->id; }
<?php require dirname(__DIR__) . '/../vendor/autoload.php'; use keika299\ConohaAPI\Conoha; $client = new Conoha(); $identityService = $client->identityService(); echo json_encode($identityService->getVersionInfo());
public function testIdentityService() { $this->assertInstanceOf('\\keika299\\ConohaAPI\\Identity\\Service', $this->client->identityService()); }