You are here

protected function NodeCacheTagsTest::getAdditionalCacheContextsForEntity in Drupal 8

Same name and namespace in other branches
  1. 9 core/modules/node/tests/src/Functional/NodeCacheTagsTest.php \Drupal\Tests\node\Functional\NodeCacheTagsTest::getAdditionalCacheContextsForEntity()
  2. 10 core/modules/node/tests/src/Functional/NodeCacheTagsTest.php \Drupal\Tests\node\Functional\NodeCacheTagsTest::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.

Overrides EntityCacheTagsTestBase::getAdditionalCacheContextsForEntity

See also

\Drupal\Tests\system\Functional\Entity\EntityCacheTagsTestBase::createEntity()

File

core/modules/node/tests/src/Functional/NodeCacheTagsTest.php, line 60

Class

NodeCacheTagsTest
Tests the Node entity's cache tags.

Namespace

Drupal\Tests\node\Functional

Code

protected function getAdditionalCacheContextsForEntity(EntityInterface $entity) {
  return [
    'timezone',
  ];
}