protected function EntityCacheTagsTestBase::getAdditionalCacheContextsForEntity in Zircon Profile 8.0
Same name and namespace in other branches
- 8 core/modules/system/src/Tests/Entity/EntityCacheTagsTestBase.php \Drupal\system\Tests\Entity\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.
2 methods override EntityCacheTagsTestBase::getAdditionalCacheContextsForEntity()
- CommentCacheTagsTest::getAdditionalCacheContextsForEntity in core/
modules/ comment/ src/ Tests/ CommentCacheTagsTest.php - Returns the additional (non-standard) cache contexts for the tested entity.
- NodeCacheTagsTest::getAdditionalCacheContextsForEntity in core/
modules/ node/ src/ Tests/ NodeCacheTagsTest.php - Returns the additional (non-standard) cache contexts for the tested entity.
File
- core/
modules/ system/ src/ Tests/ Entity/ EntityCacheTagsTestBase.php, line 163 - Contains \Drupal\system\Tests\Entity\EntityCacheTagsTestBase.
Class
- EntityCacheTagsTestBase
- Provides helper methods for Entity cache tags tests.
Namespace
Drupal\system\Tests\EntityCode
protected function getAdditionalCacheContextsForEntity(EntityInterface $entity) {
return [];
}