function CommentCacheTagsTest::getAdditionalCacheTagsForEntity
Each comment must have a comment body, which always has a text format.
Parameters
\Drupal\Core\Entity\EntityInterface $entity: The entity to be tested, as created by createEntity().
Return value
array An array of the additional cache tags.
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\FunctionalCode
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.