function WorkspaceTest::getExpectedUnauthorizedAccessCacheability

Same name in other branches
  1. 11.x core/modules/jsonapi/tests/src/Functional/WorkspaceTest.php \Drupal\Tests\jsonapi\Functional\WorkspaceTest::getExpectedUnauthorizedAccessCacheability()

Overrides ResourceTestBase::getExpectedUnauthorizedAccessCacheability

File

core/modules/jsonapi/tests/src/Functional/WorkspaceTest.php, line 221

Class

WorkspaceTest
JSON:API integration test for the "Workspace" content entity type.

Namespace

Drupal\Tests\jsonapi\Functional

Code

protected function getExpectedUnauthorizedAccessCacheability() : CacheableMetadata {
    // @see \Drupal\workspaces\WorkspaceAccessControlHandler::checkAccess()
    return parent::getExpectedUnauthorizedAccessCacheability()->addCacheTags([
        'workspace:campaign',
    ])
        ->addCacheContexts([
        'user',
    ]);
}

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