TestCacheableDependency.php in Drupal 8
File
core/tests/Drupal/Tests/Core/Render/TestCacheableDependency.php
View source
<?php
namespace Drupal\Tests\Core\Render;
use Drupal\Core\Cache\CacheableDependencyInterface;
class TestCacheableDependency implements CacheableDependencyInterface {
public function __construct(array $contexts, array $tags, $max_age) {
$this->contexts = $contexts;
$this->tags = $tags;
$this->maxAge = $max_age;
}
public function getCacheContexts() {
return $this->contexts;
}
public function getCacheTags() {
return $this->tags;
}
public function getCacheMaxAge() {
return $this->maxAge;
}
}