function DynamicMenuLinkMock::getCacheContexts

Same name in other branches
  1. 8.9.x core/tests/Drupal/Tests/Core/Menu/DynamicMenuLinkMock.php \Drupal\Tests\Core\Menu\DynamicMenuLinkMock::getCacheContexts()
  2. 10 core/tests/Drupal/Tests/Core/Menu/DynamicMenuLinkMock.php \Drupal\Tests\Core\Menu\DynamicMenuLinkMock::getCacheContexts()
  3. 11.x core/tests/Drupal/Tests/Core/Menu/DynamicMenuLinkMock.php \Drupal\Tests\Core\Menu\DynamicMenuLinkMock::getCacheContexts()

Overrides MenuLinkMock::getCacheContexts

File

core/tests/Drupal/Tests/Core/Menu/DynamicMenuLinkMock.php, line 66

Class

DynamicMenuLinkMock
Defines a mock implementation of a dynamic menu link used in tests only.

Namespace

Drupal\Tests\Core\Menu

Code

public function getCacheContexts() {
    return [
        'user.roles:authenticated',
    ];
}

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