You are here

class ClientCredentialsTest in Auth0 Single Sign On 8.2

Hierarchy

Expanded class hierarchy of ClientCredentialsTest

File

vendor/auth0/auth0-php/tests/API/Authentication/ClientCredentialsTest.php, line 7

Namespace

Auth0\Tests\API\Authentication
View source
class ClientCredentialsTest extends ApiTests {
  public function testOauthToken() {
    $env = self::getEnv();
    $api = new Authentication($env['DOMAIN'], $env['APP_CLIENT_ID'], $env['APP_CLIENT_SECRET']);
    $token = $api
      ->client_credentials([
      'audience' => 'https://' . $env['DOMAIN'] . '/api/v2/',
    ]);
    $this
      ->assertArrayHasKey('access_token', $token);
    $this
      ->assertArrayHasKey('token_type', $token);
    $this
      ->assertEquals('bearer', strtolower($token['token_type']));
  }

}

Members

Namesort descending Modifiers Type Description Overrides
ApiTests::$env protected static property Environment variables.
ApiTests::getEnv protected static function Get all test suite environment variables.
ClientCredentialsTest::testOauthToken public function
ErrorHelpers::errorHasString protected function Does an error message contain a specific string?