You are here

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

Test for missing issuer for RS256 tokens.

Return value

void

File

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

Class

TokenTest
Class TokenTest

Namespace

Auth0\Tests\Api\Helpers

Code

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