function ShortcutCacheTagsTest::setUp

Overrides EntityCacheTagsTestBase::setUp

File

core/modules/shortcut/tests/src/Functional/ShortcutCacheTagsTest.php, line 34

Class

ShortcutCacheTagsTest
Tests the Shortcut entity's cache tags.

Namespace

Drupal\Tests\shortcut\Functional

Code

protected function setUp() {
  parent::setUp();
  // Give anonymous users permission to customize shortcut links, so that we
  // can verify the cache tags of cached versions of shortcuts.
  $user_role = Role::load(RoleInterface::ANONYMOUS_ID);
  $user_role->grantPermission('customize shortcut links');
  $user_role->grantPermission('access shortcuts');
  $user_role->save();
}

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