function EntityWithUriCacheTagsTestBase::getDefaultCacheContexts

Gets the default cache contexts for rendered entities.

Return value

array The default cache contexts for rendered entities.

2 calls to EntityWithUriCacheTagsTestBase::getDefaultCacheContexts()
EntityWithUriCacheTagsTestBase::testEntityUri in core/modules/system/tests/src/Functional/Entity/EntityWithUriCacheTagsTestBase.php
Tests cache tags presence and invalidation of the entity at its URI.
NodeCacheTagsTest::getDefaultCacheContexts in core/modules/node/tests/src/Functional/NodeCacheTagsTest.php
Gets the default cache contexts for rendered entities.
1 method overrides EntityWithUriCacheTagsTestBase::getDefaultCacheContexts()
NodeCacheTagsTest::getDefaultCacheContexts in core/modules/node/tests/src/Functional/NodeCacheTagsTest.php
Gets the default cache contexts for rendered entities.

File

core/modules/system/tests/src/Functional/Entity/EntityWithUriCacheTagsTestBase.php, line 136

Class

EntityWithUriCacheTagsTestBase
Provides helper methods for Entity cache tags tests; for entities with URIs.

Namespace

Drupal\Tests\system\Functional\Entity

Code

protected function getDefaultCacheContexts() {
  return [
    'languages:' . LanguageInterface::TYPE_INTERFACE,
    'theme',
    'user.permissions',
  ];
}

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