class FooCacheContext

Same name and namespace in other branches
  1. 9 core/tests/Drupal/Tests/Core/Cache/Context/CacheContextsManagerTest.php \Drupal\Tests\Core\Cache\Context\FooCacheContext
  2. 10 core/tests/Drupal/Tests/Core/Cache/Context/CacheContextsManagerTest.php \Drupal\Tests\Core\Cache\Context\FooCacheContext
  3. 11.x core/tests/Drupal/Tests/Core/Cache/Context/CacheContextsManagerTest.php \Drupal\Tests\Core\Cache\Context\FooCacheContext

Fake cache context class.

Hierarchy

Expanded class hierarchy of FooCacheContext

File

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

Namespace

Drupal\Tests\Core\Cache\Context
View source
class FooCacheContext implements CacheContextInterface {
    
    /**
     * {@inheritdoc}
     */
    public static function getLabel() {
        return 'Foo';
    }
    
    /**
     * {@inheritdoc}
     */
    public function getContext() {
        return 'bar';
    }
    
    /**
     * {@inheritdoc}
     */
    public function getCacheableMetadata() {
        return new CacheableMetadata();
    }

}

Members

Title Sort descending Modifiers Object type Summary Overriden Title
FooCacheContext::getCacheableMetadata public function Gets the cacheability metadata for the context. Overrides CacheContextInterface::getCacheableMetadata
FooCacheContext::getContext public function Returns the string representation of the cache context. Overrides CacheContextInterface::getContext
FooCacheContext::getLabel public static function Returns the label of the cache context. Overrides CacheContextInterface::getLabel

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