function ViewResourceTestBase::getExpectedCacheContexts

Same name and namespace in other branches
  1. 8.9.x core/modules/views/tests/src/Functional/Rest/ViewResourceTestBase.php \Drupal\Tests\views\Functional\Rest\ViewResourceTestBase::getExpectedCacheContexts()

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

Return value

string[] The expected cache contexts.

Overrides EntityResourceTestBase::getExpectedCacheContexts

File

core/modules/views/tests/src/Functional/Rest/ViewResourceTestBase.php, line 98

Class

ViewResourceTestBase
Resource test base for the view entity.

Namespace

Drupal\Tests\views\Functional\Rest

Code

protected function getExpectedCacheContexts() {
  // 'session' is bubbled by URL generation for CSRF-protected routes
  // referenced in the response normalization.
  return array_merge([
    'session',
  ], parent::getExpectedCacheContexts());
}

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