function EntityResourceTestBase::getExpectedCacheContexts

Same name and namespace in other branches
  1. 11.x core/modules/rest/tests/src/Functional/EntityResource/EntityResourceTestBase.php \Drupal\Tests\rest\Functional\EntityResource\EntityResourceTestBase::getExpectedCacheContexts()
  2. 10 core/modules/rest/tests/src/Functional/EntityResource/EntityResourceTestBase.php \Drupal\Tests\rest\Functional\EntityResource\EntityResourceTestBase::getExpectedCacheContexts()
  3. 8.9.x core/modules/rest/tests/src/Functional/EntityResource/EntityResourceTestBase.php \Drupal\Tests\rest\Functional\EntityResource\EntityResourceTestBase::getExpectedCacheContexts()

The expected cache contexts for the GET/HEAD response of the test entity.

Return value

string[]

See also

::testGet

1 call to EntityResourceTestBase::getExpectedCacheContexts()
EntityTestHalJsonInternalPropertyNormalizerTest::getExpectedCacheContexts in core/modules/hal/tests/src/Functional/entity_test/EntityTestHalJsonInternalPropertyNormalizerTest.php
The expected cache contexts for the GET/HEAD response of the test entity.
6 methods override EntityResourceTestBase::getExpectedCacheContexts()
CommentResourceTestBase::getExpectedCacheContexts in core/modules/comment/tests/src/Functional/Rest/CommentResourceTestBase.php
The expected cache contexts for the GET/HEAD response of the test entity.
ConfigurableLanguageResourceTestBase::getExpectedCacheContexts in core/modules/language/tests/src/Functional/Rest/ConfigurableLanguageResourceTestBase.php
The expected cache contexts for the GET/HEAD response of the test entity.
EntityTestHalJsonInternalPropertyNormalizerTest::getExpectedCacheContexts in core/modules/hal/tests/src/Functional/entity_test/EntityTestHalJsonInternalPropertyNormalizerTest.php
The expected cache contexts for the GET/HEAD response of the test entity.
EntityTestJsonInternalPropertyNormalizerTest::getExpectedCacheContexts in core/modules/system/tests/modules/entity_test/tests/src/Functional/Rest/EntityTestJsonInternalPropertyNormalizerTest.php
The expected cache contexts for the GET/HEAD response of the test entity.
FileResourceTestBase::getExpectedCacheContexts in core/modules/file/tests/src/Functional/Rest/FileResourceTestBase.php
The expected cache contexts for the GET/HEAD response of the test entity.

... See full list

File

core/modules/rest/tests/src/Functional/EntityResource/EntityResourceTestBase.php, line 398

Class

EntityResourceTestBase
Defines a base class for testing all entity resources.

Namespace

Drupal\Tests\rest\Functional\EntityResource

Code

protected function getExpectedCacheContexts() {
  return [
    'url.site',
    'user.permissions',
  ];
}

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