You are here

protected function EntityCacheTagsTestBase::getAccessCacheContextsForEntity in Drupal 9

Same name and namespace in other branches
  1. 8 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\Entity

Code

protected function getAccessCacheContextsForEntity(EntityInterface $entity) {
  return [];
}