function CacheContextsManagerTest::testConvertTokensToKeys
@covers ::convertTokensToKeys
      
    
File
- 
              core/
tests/ Drupal/ Tests/ Core/ Cache/ Context/ CacheContextsManagerTest.php, line 107  
Class
- CacheContextsManagerTest
 - @coversDefaultClass \Drupal\Core\Cache\Context\CacheContextsManager[[api-linebreak]] @group Cache
 
Namespace
Drupal\Tests\Core\Cache\ContextCode
public function testConvertTokensToKeys() : void {
  $container = $this->getMockContainer();
  $cache_contexts_manager = new CacheContextsManager($container, $this->getContextsFixture());
  $new_keys = $cache_contexts_manager->convertTokensToKeys([
    'foo',
    'baz:parameterA',
    'baz:parameterB',
  ]);
  $expected = [
    '[baz:parameterA]=cnenzrgreN',
    '[baz:parameterB]=cnenzrgreO',
    '[foo]=bar',
  ];
  $this->assertEquals($expected, $new_keys->getKeys());
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.