You are here

public function TokenTest::testThatMissingSecretThrowsException in Auth0 Single Sign On 8.2

Test that a secret is required for an HS256 token.

Return value

void

File

vendor/auth0/auth0-php/tests/API/Helpers/TokenGeneratorTest.php, line 112

Class

TokenTest
Class TokenTest

Namespace

Auth0\Tests\Api\Helpers

Code

public function testThatMissingSecretThrowsException() {
  $caught_exception = false;
  try {
    new JWTVerifier([
      'valid_audiences' => [
        uniqid(),
      ],
      'supported_algs' => [
        'HS256',
      ],
    ]);
  } catch (CoreException $e) {
    $caught_exception = $this
      ->errorHasString($e, 'The client_secret is required');
  }
  $this
    ->assertTrue($caught_exception);
}