function EntityCacheTagsTestBase::getAdditionalCacheContextsForEntity
Returns the additional (non-standard) cache contexts for the tested entity.
Only list cache contexts that aren't part of the required cache contexts.
Parameters
\Drupal\Core\Entity\EntityInterface $entity: The entity to be tested, as created by createEntity().
Return value
string[] An array of the additional cache contexts.
See also
\Drupal\system\Tests\Entity\EntityCacheTagsTestBase::createEntity()
2 calls to EntityCacheTagsTestBase::getAdditionalCacheContextsForEntity()
- EntityCacheTagsTestBase::testReferencedEntity in core/
modules/ system/ src/ Tests/ Entity/ EntityCacheTagsTestBase.php - Tests cache tags presence and invalidation of the entity when referenced.
- EntityWithUriCacheTagsTestBase::testEntityUri in core/
modules/ system/ src/ Tests/ Entity/ EntityWithUriCacheTagsTestBase.php - Tests cache tags presence and invalidation of the entity at its URI.
File
-
core/
modules/ system/ src/ Tests/ Entity/ EntityCacheTagsTestBase.php, line 165
Class
- EntityCacheTagsTestBase
- Provides helper methods for Entity cache tags tests.
Namespace
Drupal\system\Tests\EntityCode
protected function getAdditionalCacheContextsForEntity(EntityInterface $entity) {
return [];
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.