You are here

protected function CommentResourceTestBase::getExpectedUnauthorizedEntityAccessCacheability in Drupal 8

Same name and namespace in other branches
  1. 9 core/modules/comment/tests/src/Functional/Rest/CommentResourceTestBase.php \Drupal\Tests\comment\Functional\Rest\CommentResourceTestBase::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/comment/tests/src/Functional/Rest/CommentResourceTestBase.php, line 371

Class

CommentResourceTestBase

Namespace

Drupal\Tests\comment\Functional\Rest

Code

protected function getExpectedUnauthorizedEntityAccessCacheability($is_authenticated) {

  // @see \Drupal\comment\CommentAccessControlHandler::checkAccess()
  return parent::getExpectedUnauthorizedEntityAccessCacheability($is_authenticated)
    ->addCacheTags([
    'comment:1',
  ]);
}