You are here

protected function BlockTest::getExpectedUnauthorizedAccessCacheability in JSON:API 8.2

Same name and namespace in other branches
  1. 8 tests/src/Functional/BlockTest.php \Drupal\Tests\jsonapi\Functional\BlockTest::getExpectedUnauthorizedAccessCacheability()

Returns the expected cacheability for an unauthorized response.

Return value

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

Overrides ResourceTestBase::getExpectedUnauthorizedAccessCacheability

File

tests/src/Functional/BlockTest.php, line 169

Class

BlockTest
JSON:API integration test for the "Block" config entity type.

Namespace

Drupal\Tests\jsonapi\Functional

Code

protected function getExpectedUnauthorizedAccessCacheability() {

  // @see \Drupal\block\BlockAccessControlHandler::checkAccess()
  return parent::getExpectedUnauthorizedAccessCacheability()
    ->setCacheTags([
    '4xx-response',
    'config:block.block.llama',
    'http_response',
    'user:2',
  ])
    ->setCacheContexts([
    'url.site',
    'user.roles',
  ]);
}