protected function TermTest::getExpectedUnauthorizedAccessCacheability in JSON:API 8.2
Returns the expected cacheability for an unauthorized response.
Return value
\Drupal\Core\Cache\CacheableMetadata The expected cacheability.
Overrides ResourceTestBase::getExpectedUnauthorizedAccessCacheability
File
- tests/
src/ Functional/ TermTest.php, line 371
Class
- TermTest
- JSON:API integration test for the "Term" content entity type.
Namespace
Drupal\Tests\jsonapi\FunctionalCode
protected function getExpectedUnauthorizedAccessCacheability() {
$cacheability = parent::getExpectedUnauthorizedAccessCacheability();
if (floatval(\Drupal::VERSION) >= 8.6) {
$cacheability
->addCacheableDependency($this->entity);
}
return $cacheability;
}