Updated to Drupal 8.5. Core Media not yet in use.
[yaffs-website] / web / core / tests / Drupal / Tests / Core / Render / TestCacheableDependency.php
1 <?php
2
3 namespace Drupal\Tests\Core\Render;
4
5 use Drupal\Core\Cache\CacheableDependencyInterface;
6
7 /**
8  * Cacheable dependency object for use in tests.
9  */
10 class TestCacheableDependency implements CacheableDependencyInterface {
11
12   public function __construct(array $contexts, array $tags, $max_age) {
13     $this->contexts = $contexts;
14     $this->tags = $tags;
15     $this->maxAge = $max_age;
16   }
17
18   /**
19    * {@inheritdoc}
20    */
21   public function getCacheContexts() {
22     return $this->contexts;
23   }
24
25   /**
26    * {@inheritdoc}
27    */
28   public function getCacheTags() {
29     return $this->tags;
30   }
31
32   /**
33    * {@inheritdoc}
34    */
35   public function getCacheMaxAge() {
36     return $this->maxAge;
37   }
38
39 }