You are here

public function BazCacheContext::getContext in Drupal 10

Same name and namespace in other branches
  1. 8 core/tests/Drupal/Tests/Core/Cache/Context/CacheContextsManagerTest.php \Drupal\Tests\Core\Cache\Context\BazCacheContext::getContext()
  2. 9 core/tests/Drupal/Tests/Core/Cache/Context/CacheContextsManagerTest.php \Drupal\Tests\Core\Cache\Context\BazCacheContext::getContext()

File

core/tests/Drupal/Tests/Core/Cache/Context/CacheContextsManagerTest.php, line 292
Contains \Drupal\Tests\Core\Cache\Context\CacheContextsManagerTest.

Class

BazCacheContext
Fake calculated cache context class.

Namespace

Drupal\Tests\Core\Cache\Context

Code

public function getContext($parameter = NULL) {
  if (!is_string($parameter) || strlen($parameter) === 0) {
    throw new \Exception();
  }
  return str_rot13($parameter);
}