function ShortcutCacheTagsTest::setUp

Overrides EntityCacheTagsTestBase::setUp

File

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

Class

ShortcutCacheTagsTest
Tests the Shortcut entity's cache tags.

Namespace

Drupal\Tests\shortcut\Functional

Code

protected function setUp() : void {
  parent::setUp();
  $this->adminUser = $this->drupalCreateUser([
    'access toolbar',
    'access shortcuts',
    'administer site configuration',
    'administer shortcuts',
    'administer themes',
  ]);
  // 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.