You are here

public function RefreshTokenTest::testThatClientIdIsRequired in Auth0 Single Sign On 8.2

Test that setting an empty client_id will override the default and throw an exception.

File

vendor/auth0/auth0-php/tests/API/Authentication/RefreshTokenTest.php, line 83

Class

RefreshTokenTest
Class RefreshTokenTest. Tests the \Auth0\SDK\API\Authentication::refresh_token() method.

Namespace

Auth0\Tests\API\Authentication

Code

public function testThatClientIdIsRequired() {
  $env = self::getEnv();
  $api = new Authentication($env['DOMAIN'], $env['APP_CLIENT_ID'], $env['APP_CLIENT_SECRET']);
  try {
    $api
      ->refresh_token(uniqid(), [
      'client_id' => '',
    ]);
    $caught_exception = false;
  } catch (ApiException $e) {
    $caught_exception = $this
      ->errorHasString($e, 'client_id is mandatory');
  }
  $this
    ->assertTrue($caught_exception);
}