function EntityResourceTestBase::getExpectedUnauthorizedEntityAccessCacheability

Same name and namespace in other branches
  1. 9 core/modules/rest/tests/src/Functional/EntityResource/EntityResourceTestBase.php \Drupal\Tests\rest\Functional\EntityResource\EntityResourceTestBase::getExpectedUnauthorizedEntityAccessCacheability()
  2. 8.9.x core/modules/rest/tests/src/Functional/EntityResource/EntityResourceTestBase.php \Drupal\Tests\rest\Functional\EntityResource\EntityResourceTestBase::getExpectedUnauthorizedEntityAccessCacheability()
  3. 10 core/modules/rest/tests/src/Functional/EntityResource/EntityResourceTestBase.php \Drupal\Tests\rest\Functional\EntityResource\EntityResourceTestBase::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.

2 calls to EntityResourceTestBase::getExpectedUnauthorizedEntityAccessCacheability()
EntityResourceTestBase::testGet in core/modules/rest/tests/src/Functional/EntityResource/EntityResourceTestBase.php
Tests a GET request for an entity, plus edge cases to ensure good DX.
UserResourceTestBase::getExpectedUnauthorizedEntityAccessCacheability in core/modules/user/tests/src/Functional/Rest/UserResourceTestBase.php
The cacheability of unauthorized 'view' entity access.
7 methods override EntityResourceTestBase::getExpectedUnauthorizedEntityAccessCacheability()
BlockContentResourceTestBase::getExpectedUnauthorizedEntityAccessCacheability in core/modules/block_content/tests/src/Functional/Rest/BlockContentResourceTestBase.php
The cacheability of unauthorized 'view' entity access.
BlockResourceTestBase::getExpectedUnauthorizedEntityAccessCacheability in core/modules/block/tests/src/Functional/Rest/BlockResourceTestBase.php
The cacheability of unauthorized 'view' entity access.
CommentResourceTestBase::getExpectedUnauthorizedEntityAccessCacheability in core/modules/comment/tests/src/Functional/Rest/CommentResourceTestBase.php
The cacheability of unauthorized 'view' entity access.
MediaResourceTestBase::getExpectedUnauthorizedEntityAccessCacheability in core/modules/media/tests/src/Functional/Rest/MediaResourceTestBase.php
The cacheability of unauthorized 'view' entity access.
SearchPageResourceTestBase::getExpectedUnauthorizedEntityAccessCacheability in core/modules/search/tests/src/Functional/Rest/SearchPageResourceTestBase.php
The cacheability of unauthorized 'view' entity access.

... See full list

File

core/modules/rest/tests/src/Functional/EntityResource/EntityResourceTestBase.php, line 372

Class

EntityResourceTestBase
Defines a base class for testing all entity resources.

Namespace

Drupal\Tests\rest\Functional\EntityResource

Code

protected function getExpectedUnauthorizedEntityAccessCacheability($is_authenticated) {
    return new CacheableMetadata();
}

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