You are here

public function JWKFetcherTest::testGetJwksX5cWithoutKid in Auth0 Single Sign On 8.2

Test that a standard JWKS path returns the first x5c.

Return value

void

File

vendor/auth0/auth0-php/tests/Helpers/JWKFetcherTest.php, line 81

Class

JWKFetcherTest
Class JWKFetcherTest.

Namespace

Auth0\Tests\Helpers

Code

public function testGetJwksX5cWithoutKid() {
  $jwksFetcher = $this
    ->getStub();
  $pem = $jwksFetcher
    ->requestJwkX5c('https://localhost/.well-known/jwks.json');
  $this
    ->assertNotEmpty($pem);
  $pem_parts = explode(PHP_EOL, $pem);
  $this
    ->assertEquals(4, count($pem_parts));
  $this
    ->assertEquals('-----BEGIN CERTIFICATE-----', $pem_parts[0]);
  $this
    ->assertEquals('-----END CERTIFICATE-----', $pem_parts[2]);
  $this
    ->assertEquals('__test_x5c_1__', $pem_parts[1]);
}