You are here

protected function ShortcutHalJsonAnonTest::getExpectedCacheContexts in Drupal 8

Same name and namespace in other branches
  1. 9 core/modules/shortcut/tests/src/Functional/Hal/ShortcutHalJsonAnonTest.php \Drupal\Tests\shortcut\Functional\Hal\ShortcutHalJsonAnonTest::getExpectedCacheContexts()

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

Return value

string[]

Overrides EntityResourceTestBase::getExpectedCacheContexts

See also

::testGet

File

core/modules/shortcut/tests/src/Functional/Hal/ShortcutHalJsonAnonTest.php, line 74

Class

ShortcutHalJsonAnonTest
@group hal

Namespace

Drupal\Tests\shortcut\Functional\Hal

Code

protected function getExpectedCacheContexts() {

  // The 'url.site' cache context is added for '_links' in the response.
  return Cache::mergeContexts(parent::getExpectedCacheContexts(), [
    'url.site',
  ]);
}