You are here

public function JWKTest::testNoCache in Auth0 Single Sign On 8.2

File

vendor/auth0/auth0-php/tests/API/Helpers/JWKTests.php, line 12

Class

JWKTest

Namespace

Auth0\Tests\Api\Helpers

Code

public function testNoCache() {
  $env = self::getEnv();
  $cache = new CacheDecorator(new NoCacheHandler());
  $fetcher = new JWKFetcher($cache);
  $keys = $fetcher
    ->fetchKeys($env['DOMAIN']);
  $this
    ->assertTrue(is_array($keys));
  $keys = $fetcher
    ->fetchKeys($env['DOMAIN']);
  $this
    ->assertTrue(is_array($keys));
  $this
    ->assertEquals(2, $cache
    ->count('get'));
  $this
    ->assertEquals(2, $cache
    ->count('set'));
  $this
    ->assertEquals(0, $cache
    ->count('delete'));
}