You are here

protected function CacheTest::assertKeys in Apigee Edge 8

Check to see if the given cache keys exist.

Parameters

array $keys: Cache keys to check.

bool $should_exist: TRUE if the cache keys should exist.

1 call to CacheTest::assertKeys()
CacheTest::assertCacheInvalidation in tests/src/FunctionalJavascript/CacheTest.php
Check to see if the cache is invalidated.

File

tests/src/FunctionalJavascript/CacheTest.php, line 319

Class

CacheTest
Apigee Edge entity cache related tests.

Namespace

Drupal\Tests\apigee_edge\FunctionalJavascript

Code

protected function assertKeys(array $keys, bool $should_exist) {
  foreach ($keys as $key) {
    $value = $this->cacheBackend
      ->get($key);
    if ($should_exist) {
      $this
        ->assertNotFalse($value, "Cache key has not found when it should: {$key}");
    }
    else {
      $this
        ->assertFalse($value, "Cache key found when it should not: {$key}");
    }
  }
}