You are here

public function CacheContextsTest::test_convertTokensToKeys in Render cache 7.2

Tests that CacheContexts::convertTokensToKeys() is working properly. @covers ::convertTokensToKeys()

File

tests/src/Cache/CacheContextsTest.php, line 68
Contains \Drupal\render_cache\Tests\Cache\CacheContextsTest

Class

CacheContextsTest
@coversDefaultClass \Drupal\render_cache\Cache\CacheContexts @group cache

Namespace

Drupal\render_cache\Tests\Cache

Code

public function test_convertTokensToKeys() {
  $tokens = array(
    'foo',
    'bar',
    'cache_context.foo',
  );
  $altered_tokens = array(
    'foo',
    'bar',
    'bar',
  );
  $this
    ->assertEquals($altered_tokens, $this->cacheContexts
    ->convertTokensToKeys($tokens), 'Cache Contexts can be converted properly.');
}