Exemplo n.º 1
0
 public function getClient()
 {
     $client = new Client(['http_errors' => false]);
     if ($this->token instanceof Token) {
         $client->setApiToken($this->token->getId());
     }
     return $client;
 }
Exemplo n.º 2
0
    /**
     * @expectedException ConoHa\Exception\HttpErrorException
     */
    public function testConstructorWithJsonError()
    {
        if (!API_TEST) {
            $this->markTestSkipped('This test requires API access to execute.');
        }
        $secret = '
{
  "auth": {
    "passwordCredentials": {
      "username": "******",
      "password": "******"
    },
    "tenantId": "487727e3921d44e3bfe7ebb337bf085e"
  }
}
';
        $client = new Client();
        $res = $client->post(TEST_IDENTITY_ENDPOINT . "/v2.0/tokens", ['body' => $secret]);
    }