You are here

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

Test that a custom JWKS path returns the correct JSON.

Return value

void

File

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

Class

JWKFetcherTest
Class JWKFetcherTest.

Namespace

Auth0\Tests\Helpers

Code

public function testGetJwksX5cWithPath() {
  $jwksFetcher = $this
    ->getStub();
  $pem = $jwksFetcher
    ->requestJwkX5c('https://localhost/.custom/jwks.json', '__test_custom_kid__');
  $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_custom_x5c__', $pem_parts[1]);
}