function CacheContextsManagerTest::testInvalidContext

Tests invalid context.

@legacy-covers ::convertTokensToKeys

File

core/tests/Drupal/Tests/Core/Cache/Context/CacheContextsManagerTest.php, line 136

Class

CacheContextsManagerTest
Tests Drupal\Core\Cache\Context\CacheContextsManager.

Namespace

Drupal\Tests\Core\Cache\Context

Code

public function testInvalidContext() : void {
  $container = $this->getMockContainer();
  $cache_contexts_manager = new CacheContextsManager($container, $this->getContextsFixture());
  $this->expectException(\AssertionError::class);
  $cache_contexts_manager->convertTokensToKeys([
    "non-cache-context",
  ]);
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.