function ResourceTestBase::getExpectedCacheTags
Same name in other branches
- 9 core/modules/jsonapi/tests/src/Functional/ResourceTestBase.php \Drupal\Tests\jsonapi\Functional\ResourceTestBase::getExpectedCacheTags()
- 8.9.x core/modules/jsonapi/tests/src/Functional/ResourceTestBase.php \Drupal\Tests\jsonapi\Functional\ResourceTestBase::getExpectedCacheTags()
- 10 core/modules/jsonapi/tests/src/Functional/ResourceTestBase.php \Drupal\Tests\jsonapi\Functional\ResourceTestBase::getExpectedCacheTags()
The expected cache tags for the GET/HEAD response of the test entity.
Parameters
array|null $sparse_fieldset: If a sparse fieldset is being requested, limit the expected cache tags for this entity's fields to just these fields.
Return value
string[] A set of cache tags.
See also
::testGetIndividual()
10 calls to ResourceTestBase::getExpectedCacheTags()
- BlockContentTest::getExpectedCacheTags in core/
modules/ jsonapi/ tests/ src/ Functional/ BlockContentTest.php - BlockTest::getExpectedCacheTags in core/
modules/ jsonapi/ tests/ src/ Functional/ BlockTest.php - CommentTest::getExpectedCacheTags in core/
modules/ jsonapi/ tests/ src/ Functional/ CommentTest.php - EntityTestComputedFieldTest::getExpectedCacheTags in core/
modules/ jsonapi/ tests/ src/ Functional/ EntityTestComputedFieldTest.php - NodeTest::testGetIndividual in core/
modules/ jsonapi/ tests/ src/ Functional/ NodeTest.php
5 methods override ResourceTestBase::getExpectedCacheTags()
- BlockContentTest::getExpectedCacheTags in core/
modules/ jsonapi/ tests/ src/ Functional/ BlockContentTest.php - BlockTest::getExpectedCacheTags in core/
modules/ jsonapi/ tests/ src/ Functional/ BlockTest.php - CommentTest::getExpectedCacheTags in core/
modules/ jsonapi/ tests/ src/ Functional/ CommentTest.php - EntityTestComputedFieldTest::getExpectedCacheTags in core/
modules/ jsonapi/ tests/ src/ Functional/ EntityTestComputedFieldTest.php - TermTest::getExpectedCacheTags in core/
modules/ jsonapi/ tests/ src/ Functional/ TermTest.php
File
-
core/
modules/ jsonapi/ tests/ src/ Functional/ ResourceTestBase.php, line 506
Class
- ResourceTestBase
- Subclass this for every JSON:API resource type.
Namespace
Drupal\Tests\jsonapi\FunctionalCode
protected function getExpectedCacheTags(?array $sparse_fieldset = NULL) {
$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.