function DbLogResourceTest::getExpectedUnauthorizedAccessCacheability

Returns the expected cacheability of an unauthorized access response.

Return value

\Drupal\Core\Cache\RefinableCacheableDependencyInterface The expected cacheability.

Overrides ResourceTestBase::getExpectedUnauthorizedAccessCacheability

File

core/modules/dblog/tests/src/Functional/DbLogResourceTest.php, line 157

Class

DbLogResourceTest
Tests the watchdog database log resource.

Namespace

Drupal\Tests\dblog\Functional

Code

protected function getExpectedUnauthorizedAccessCacheability() {
  return (new CacheableMetadata())->setCacheTags([
    '4xx-response',
    'http_response',
  ])
    ->setCacheContexts([
    'user.permissions',
  ]);
}

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