function EntityResourceTestBase::getExpectedCacheTags
Same name in other branches
- 9 core/modules/rest/tests/src/Functional/EntityResource/EntityResourceTestBase.php \Drupal\Tests\rest\Functional\EntityResource\EntityResourceTestBase::getExpectedCacheTags()
- 10 core/modules/rest/tests/src/Functional/EntityResource/EntityResourceTestBase.php \Drupal\Tests\rest\Functional\EntityResource\EntityResourceTestBase::getExpectedCacheTags()
- 11.x core/modules/rest/tests/src/Functional/EntityResource/EntityResourceTestBase.php \Drupal\Tests\rest\Functional\EntityResource\EntityResourceTestBase::getExpectedCacheTags()
The expected cache tags for the GET/HEAD response of the test entity.
Return value
string[]
See also
::testGet
11 calls to EntityResourceTestBase::getExpectedCacheTags()
- BlockContentResourceTestBase::getExpectedCacheTags in core/
modules/ block_content/ tests/ src/ Functional/ Rest/ BlockContentResourceTestBase.php - The expected cache tags for the GET/HEAD response of the test entity.
- BlockResourceTestBase::getExpectedCacheTags in core/
modules/ block/ tests/ src/ Functional/ Rest/ BlockResourceTestBase.php - The expected cache tags for the GET/HEAD response of the test entity.
- CommentResourceTestBase::getExpectedCacheTags in core/
modules/ comment/ tests/ src/ Functional/ Rest/ CommentResourceTestBase.php - The expected cache tags for the GET/HEAD response of the test entity.
- EntityResourceTestBase::testGet in core/
modules/ rest/ tests/ src/ Functional/ EntityResource/ EntityResourceTestBase.php - Test a GET request for an entity, plus edge cases to ensure good DX.
- EntityTestHalJsonInternalPropertyNormalizerTest::getExpectedCacheTags in core/
modules/ system/ tests/ modules/ entity_test/ tests/ src/ Functional/ Hal/ EntityTestHalJsonInternalPropertyNormalizerTest.php - The expected cache tags for the GET/HEAD response of the test entity.
9 methods override EntityResourceTestBase::getExpectedCacheTags()
- BlockContentResourceTestBase::getExpectedCacheTags in core/
modules/ block_content/ tests/ src/ Functional/ Rest/ BlockContentResourceTestBase.php - The expected cache tags for the GET/HEAD response of the test entity.
- BlockResourceTestBase::getExpectedCacheTags in core/
modules/ block/ tests/ src/ Functional/ Rest/ BlockResourceTestBase.php - The expected cache tags for the GET/HEAD response of the test entity.
- CommentResourceTestBase::getExpectedCacheTags in core/
modules/ comment/ tests/ src/ Functional/ Rest/ CommentResourceTestBase.php - The expected cache tags for the GET/HEAD response of the test entity.
- EntityTestHalJsonInternalPropertyNormalizerTest::getExpectedCacheTags in core/
modules/ system/ tests/ modules/ entity_test/ tests/ src/ Functional/ Hal/ EntityTestHalJsonInternalPropertyNormalizerTest.php - The expected cache tags for the GET/HEAD response of the test entity.
- EntityTestJsonInternalPropertyNormalizerTest::getExpectedCacheTags in core/
modules/ system/ tests/ modules/ entity_test/ tests/ src/ Functional/ Rest/ EntityTestJsonInternalPropertyNormalizerTest.php - The expected cache tags for the GET/HEAD response of the test entity.
File
-
core/
modules/ rest/ tests/ src/ Functional/ EntityResource/ EntityResourceTestBase.php, line 403
Class
- EntityResourceTestBase
- Even though there is the generic EntityResource, it's necessary for every entity type to have its own test, because they each have different fields, validation constraints, et cetera. It's not because the generic case works, that every case…
Namespace
Drupal\Tests\rest\Functional\EntityResourceCode
protected function getExpectedCacheTags() {
$expected_cache_tags = [
'config:rest.resource.entity.' . static::$entityTypeId,
// Necessary for 'bc_entity_resource_permissions'.
// @see \Drupal\rest\Plugin\rest\resource\EntityResource::permissions()
'config:rest.settings',
];
if (!static::$auth) {
$expected_cache_tags[] = 'config:user.role.anonymous';
}
$expected_cache_tags[] = 'http_response';
return Cache::mergeTags($expected_cache_tags, $this->entity
->getCacheTags());
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.