protected function MediaCacheTagsTest::getAdditionalCacheTagsForEntity in Drupal 9
Same name and namespace in other branches
- 8 core/modules/media/tests/src/Functional/MediaCacheTagsTest.php \Drupal\Tests\media\Functional\MediaCacheTagsTest::getAdditionalCacheTagsForEntity()
Returns the additional (non-standard) cache tags for the tested entity.
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
See also
\Drupal\Tests\system\Functional\Entity\EntityCacheTagsTestBase::createEntity()
File
- core/
modules/ media/ tests/ src/ Functional/ MediaCacheTagsTest.php, line 71
Class
- MediaCacheTagsTest
- Tests the media items cache tags.
Namespace
Drupal\Tests\media\FunctionalCode
protected function getAdditionalCacheTagsForEntity(EntityInterface $media) {
// Each media item must have an author and a thumbnail.
return [
'user:' . $media
->getOwnerId(),
'config:image.style.thumbnail',
'file:' . $media
->get('thumbnail')->entity
->id(),
];
}