You are here

protected function ShortcutCacheTagsTest::setUp in Drupal 8

Same name and namespace in other branches
  1. 9 core/modules/shortcut/tests/src/Functional/ShortcutCacheTagsTest.php \Drupal\Tests\shortcut\Functional\ShortcutCacheTagsTest::setUp()
  2. 10 core/modules/shortcut/tests/src/Functional/ShortcutCacheTagsTest.php \Drupal\Tests\shortcut\Functional\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();
}