class FooCacheContext

Same name in other branches
  1. 9 core/tests/Drupal/Tests/Core/Cache/Context/CacheContextsManagerTest.php \Drupal\Tests\Core\Cache\Context\FooCacheContext
  2. 8.9.x core/tests/Drupal/Tests/Core/Cache/Context/CacheContextsManagerTest.php \Drupal\Tests\Core\Cache\Context\FooCacheContext
  3. 10 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 252

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


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