function EntityCacheTagsTestBase::getAccessCacheContextsForEntity
Same name in other branches
- 8.9.x core/modules/system/src/Tests/Entity/EntityCacheTagsTestBase.php \Drupal\system\Tests\Entity\EntityCacheTagsTestBase::getAccessCacheContextsForEntity()
- 8.9.x core/modules/system/tests/src/Functional/Entity/EntityCacheTagsTestBase.php \Drupal\Tests\system\Functional\Entity\EntityCacheTagsTestBase::getAccessCacheContextsForEntity()
- 10 core/modules/system/tests/src/Functional/Entity/EntityCacheTagsTestBase.php \Drupal\Tests\system\Functional\Entity\EntityCacheTagsTestBase::getAccessCacheContextsForEntity()
- 11.x core/modules/system/tests/src/Functional/Entity/EntityCacheTagsTestBase.php \Drupal\Tests\system\Functional\Entity\EntityCacheTagsTestBase::getAccessCacheContextsForEntity()
Returns the access 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\Core\Entity\EntityAccessControlHandlerInterface
1 call to EntityCacheTagsTestBase::getAccessCacheContextsForEntity()
- EntityCacheTagsTestBase::testReferencedEntity in core/
modules/ system/ tests/ src/ Functional/ Entity/ EntityCacheTagsTestBase.php - Tests cache tags presence and invalidation of the entity when referenced.
1 method overrides EntityCacheTagsTestBase::getAccessCacheContextsForEntity()
- BlockContentCacheTagsTest::getAccessCacheContextsForEntity in core/
modules/ block_content/ tests/ src/ Functional/ BlockContentCacheTagsTest.php
File
-
core/
modules/ system/ tests/ src/ Functional/ Entity/ EntityCacheTagsTestBase.php, line 141
Class
- EntityCacheTagsTestBase
- Provides helper methods for Entity cache tags tests.
Namespace
Drupal\Tests\system\Functional\EntityCode
protected function getAccessCacheContextsForEntity(EntityInterface $entity) {
return [];
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.