protected function ProductVariationResourceTest::getExpectedUnauthorizedAccessCacheability in Commerce Core 8.2
Returns the expected cacheability for an unauthorized response.
Return value
\Drupal\Core\Cache\CacheableMetadata The expected cacheability.
Overrides ResourceTestBase::getExpectedUnauthorizedAccessCacheability
File
- modules/
product/ tests/ src/ Functional/ Jsonapi/ ProductVariationResourceTest.php, line 294
Class
- ProductVariationResourceTest
- JSON:API resource test for variations.
Namespace
Drupal\Tests\commerce_product\Functional\JsonapiCode
protected function getExpectedUnauthorizedAccessCacheability() {
$cacheability = parent::getExpectedUnauthorizedAccessCacheability();
$cacheability
->addCacheContexts([
'url.query_args:v',
]);
$cacheability
->addCacheableDependency($this->entity);
return $cacheability;
}