You are here

protected function CommentCacheTagsTest::setUp in Drupal 8

Same name and namespace in other branches
  1. 9 core/modules/comment/tests/src/Functional/CommentCacheTagsTest.php \Drupal\Tests\comment\Functional\CommentCacheTagsTest::setUp()

Overrides EntityCacheTagsTestBase::setUp

File

core/modules/comment/tests/src/Functional/CommentCacheTagsTest.php, line 48

Class

CommentCacheTagsTest
Tests the Comment entity's cache tags.

Namespace

Drupal\Tests\comment\Functional

Code

protected function setUp() {
  parent::setUp();

  // Give anonymous users permission to view comments, so that we can verify
  // the cache tags of cached versions of comment pages.
  $user_role = Role::load(RoleInterface::ANONYMOUS_ID);
  $user_role
    ->grantPermission('access comments');
  $user_role
    ->save();
}