function ContextualLinkManagerTest::setUpMockCacheBackend

Reinitializes the cache backend as a mock object.

1 call to ContextualLinkManagerTest::setUpMockCacheBackend()
ContextualLinkManagerTest::testGetContextualLinkPluginsByGroupWithCache in core/tests/Drupal/Tests/Core/Menu/ContextualLinkManagerTest.php
Tests the getContextualLinkPluginsByGroup method with a prefilled cache.

File

core/tests/Drupal/Tests/Core/Menu/ContextualLinkManagerTest.php, line 104

Class

ContextualLinkManagerTest
Tests Drupal\Core\Menu\ContextualLinkManager.

Namespace

Drupal\Tests\Core\Menu

Code

protected function setUpMockCacheBackend() : void {
  $this->cacheBackend = $this->createMock(CacheBackendInterface::class);
  $reflection = new \ReflectionProperty($this->contextualLinkManager, 'cacheBackend');
  $reflection->setValue($this->contextualLinkManager, $this->cacheBackend);
}

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