You are here

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

Test that a standard JWKS path returns the correct x5c when given a kid.

Return value

void

File

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

Class

JWKFetcherTest
Class JWKFetcherTest.

Namespace

Auth0\Tests\Helpers

Code

public function testGetJwksX5cWithKid() {
  $jwksFetcher = $this
    ->getStub();
  $pem = $jwksFetcher
    ->requestJwkX5c('https://localhost/.well-known/jwks.json', '__test_kid_2__');
  $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_2__', $pem_parts[1]);
}