function CacheCollectorTest::setUp

Same name and namespace in other branches
  1. 9 core/tests/Drupal/Tests/Core/Cache/CacheCollectorTest.php \Drupal\Tests\Core\Cache\CacheCollectorTest::setUp()
  2. 8.9.x core/tests/Drupal/Tests/Core/Cache/CacheCollectorTest.php \Drupal\Tests\Core\Cache\CacheCollectorTest::setUp()
  3. 11.x core/tests/Drupal/Tests/Core/Cache/CacheCollectorTest.php \Drupal\Tests\Core\Cache\CacheCollectorTest::setUp()

Overrides UnitTestCase::setUp

File

core/tests/Drupal/Tests/Core/Cache/CacheCollectorTest.php, line 54

Class

CacheCollectorTest
@coversDefaultClass \Drupal\Core\Cache\CacheCollector[[api-linebreak]] @group Cache

Namespace

Drupal\Tests\Core\Cache

Code

protected function setUp() : void {
  parent::setUp();
  $this->cacheBackend = $this->createMock('Drupal\\Core\\Cache\\CacheBackendInterface');
  $this->cacheTagsInvalidator = $this->createMock('Drupal\\Core\\Cache\\CacheTagsInvalidatorInterface');
  $this->lock = $this->createMock('Drupal\\Core\\Lock\\LockBackendInterface');
  $this->cid = $this->randomMachineName();
  $this->collector = new CacheCollectorHelper($this->cid, $this->cacheBackend, $this->lock);
  $this->getContainerWithCacheTagsInvalidator($this->cacheTagsInvalidator);
}

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