You are here

protected function MediaResourceTestBase::getExpectedUnauthorizedEntityAccessCacheability in Drupal 10

Same name and namespace in other branches
  1. 8 core/modules/media/tests/src/Functional/Rest/MediaResourceTestBase.php \Drupal\Tests\media\Functional\Rest\MediaResourceTestBase::getExpectedUnauthorizedEntityAccessCacheability()
  2. 9 core/modules/media/tests/src/Functional/Rest/MediaResourceTestBase.php \Drupal\Tests\media\Functional\Rest\MediaResourceTestBase::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/media/tests/src/Functional/Rest/MediaResourceTestBase.php, line 460

Class

MediaResourceTestBase

Namespace

Drupal\Tests\media\Functional\Rest

Code

protected function getExpectedUnauthorizedEntityAccessCacheability($is_authenticated) {

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