function BlockResourceTestBase::getExpectedUnauthorizedAccessCacheability

Same name in other branches
  1. 9 core/modules/block/tests/src/Functional/Rest/BlockResourceTestBase.php \Drupal\Tests\block\Functional\Rest\BlockResourceTestBase::getExpectedUnauthorizedAccessCacheability()
  2. 8.9.x core/modules/block/tests/src/Functional/Rest/BlockResourceTestBase.php \Drupal\Tests\block\Functional\Rest\BlockResourceTestBase::getExpectedUnauthorizedAccessCacheability()
  3. 10 core/modules/block/tests/src/Functional/Rest/BlockResourceTestBase.php \Drupal\Tests\block\Functional\Rest\BlockResourceTestBase::getExpectedUnauthorizedAccessCacheability()

@todo Fix this in https://www.drupal.org/node/2820315.

Overrides EntityResourceTestBase::getExpectedUnauthorizedAccessCacheability

File

core/modules/block/tests/src/Functional/Rest/BlockResourceTestBase.php, line 152

Class

BlockResourceTestBase

Namespace

Drupal\Tests\block\Functional\Rest

Code

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

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