You are here

protected function UserResourceTestBase::getExpectedUnauthorizedEntityAccessCacheability in Drupal 8

Same name and namespace in other branches
  1. 9 core/modules/user/tests/src/Functional/Rest/UserResourceTestBase.php \Drupal\Tests\user\Functional\Rest\UserResourceTestBase::getExpectedUnauthorizedEntityAccessCacheability()
  2. 10 core/modules/user/tests/src/Functional/Rest/UserResourceTestBase.php \Drupal\Tests\user\Functional\Rest\UserResourceTestBase::getExpectedUnauthorizedEntityAccessCacheability()

The cacheability of unauthorized 'view' entity access.

Parameters

bool $is_authenticated: Whether the current request is authenticated or not. This matters for some entity access control handlers, but not for most.

Return value

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

Overrides EntityResourceTestBase::getExpectedUnauthorizedEntityAccessCacheability

File

core/modules/user/tests/src/Functional/Rest/UserResourceTestBase.php, line 327

Class

UserResourceTestBase

Namespace

Drupal\Tests\user\Functional\Rest

Code

protected function getExpectedUnauthorizedEntityAccessCacheability($is_authenticated) {

  // @see \Drupal\user\UserAccessControlHandler::checkAccess()
  return parent::getExpectedUnauthorizedEntityAccessCacheability($is_authenticated)
    ->addCacheTags([
    'user:3',
  ]);
}