function CommentCacheTagsTest::getAdditionalCacheTagsForEntity

Same name and namespace in other branches
  1. 8.9.x core/modules/comment/tests/src/Functional/CommentCacheTagsTest.php \Drupal\Tests\comment\Functional\CommentCacheTagsTest::getAdditionalCacheTagsForEntity()
  2. 10 core/modules/comment/tests/src/Functional/CommentCacheTagsTest.php \Drupal\Tests\comment\Functional\CommentCacheTagsTest::getAdditionalCacheTagsForEntity()
  3. 11.x core/modules/comment/tests/src/Functional/CommentCacheTagsTest.php \Drupal\Tests\comment\Functional\CommentCacheTagsTest::getAdditionalCacheTagsForEntity()

Each comment must have a comment body, which always has a text format.

Overrides EntityCacheTagsTestBase::getAdditionalCacheTagsForEntity

File

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

Class

CommentCacheTagsTest
Tests the Comment entity's cache tags.

Namespace

Drupal\Tests\comment\Functional

Code

protected function getAdditionalCacheTagsForEntity(EntityInterface $entity) {
    
    /** @var \Drupal\comment\CommentInterface $entity */
    return [
        'config:filter.format.plain_text',
        'user:' . $entity->getOwnerId(),
        'user_view',
    ];
}

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