Exemple #1
0
 public function testPopulate()
 {
     $conoha = new ConoHa();
     $ident = $conoha->getIdentityService(TEST_IDENTITY_ENDPOINT);
     $secret = __get_test_secret();
     $ident->tokens($secret);
 }
 public function testTokenFail()
 {
     $secret = __get_test_secret();
     $secret->setPassword('hoge');
     $service = new Service(TEST_IDENTITY_ENDPOINT);
     try {
         $access = $service->tokens($secret);
     } catch (\ConoHa\Exception\HttpErrorException $ex) {
         $res = $ex->getLastResponse();
         $this->assertEquals(401, $res->getHttpCode());
         return;
     }
     $this->fail('Expect to throw HttpErrorException');
 }