class TestCacheableDependency in Drupal 9
Same name and namespace in other branches
- 8 core/tests/Drupal/Tests/Core/Render/TestCacheableDependency.php \Drupal\Tests\Core\Render\TestCacheableDependency
Cacheable dependency object for use in tests.
Hierarchy
- class \Drupal\Tests\Core\Render\TestCacheableDependency implements CacheableDependencyInterface
Expanded class hierarchy of TestCacheableDependency
1 file declares its use of TestCacheableDependency
- CacheableMetadataTest.php in core/
tests/ Drupal/ Tests/ Core/ Cache/ CacheableMetadataTest.php
File
- core/
tests/ Drupal/ Tests/ Core/ Render/ TestCacheableDependency.php, line 10
Namespace
Drupal\Tests\Core\RenderView source
class TestCacheableDependency implements CacheableDependencyInterface {
public function __construct(array $contexts, array $tags, $max_age) {
$this->contexts = $contexts;
$this->tags = $tags;
$this->maxAge = $max_age;
}
/**
* {@inheritdoc}
*/
public function getCacheContexts() {
return $this->contexts;
}
/**
* {@inheritdoc}
*/
public function getCacheTags() {
return $this->tags;
}
/**
* {@inheritdoc}
*/
public function getCacheMaxAge() {
return $this->maxAge;
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
TestCacheableDependency:: |
public | function |
The cache contexts associated with this object. Overrides CacheableDependencyInterface:: |
|
TestCacheableDependency:: |
public | function |
The maximum age for which this object may be cached. Overrides CacheableDependencyInterface:: |
|
TestCacheableDependency:: |
public | function |
The cache tags associated with this object. Overrides CacheableDependencyInterface:: |
|
TestCacheableDependency:: |
public | function |