function BlockResourceTestBase::getExpectedCacheTags

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

Overrides EntityResourceTestBase::getExpectedCacheTags

File

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

Class

BlockResourceTestBase

Namespace

Drupal\Tests\block\Functional\Rest

Code

protected function getExpectedCacheTags() {
    // Because the 'user.permissions' cache context is missing, the cache tag
    // for the anonymous user role is never added automatically.
    return array_values(array_diff(parent::getExpectedCacheTags(), [
        'config:user.role.anonymous',
    ]));
}

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