function BlockContentCacheTagsTest::getAccessCacheContextsForEntity

Same name and namespace in other branches
  1. 8.9.x core/modules/block_content/tests/src/Functional/BlockContentCacheTagsTest.php \Drupal\Tests\block_content\Functional\BlockContentCacheTagsTest::getAccessCacheContextsForEntity()
  2. 10 core/modules/block_content/tests/src/Functional/BlockContentCacheTagsTest.php \Drupal\Tests\block_content\Functional\BlockContentCacheTagsTest::getAccessCacheContextsForEntity()
  3. 11.x core/modules/block_content/tests/src/Functional/BlockContentCacheTagsTest.php \Drupal\Tests\block_content\Functional\BlockContentCacheTagsTest::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.

Overrides EntityCacheTagsTestBase::getAccessCacheContextsForEntity

See also

\Drupal\block_content\BlockContentAccessControlHandler::checkAccess()

File

core/modules/block_content/tests/src/Functional/BlockContentCacheTagsTest.php, line 61

Class

BlockContentCacheTagsTest
Tests the Custom Block entity's cache tags.

Namespace

Drupal\Tests\block_content\Functional

Code

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

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.