protected function ResourceTestBase::getExpectedGetIndividualResourceResponse in JSON:API 8.2
Same name and namespace in other branches
- 8 tests/src/Functional/ResourceTestBase.php \Drupal\Tests\jsonapi\Functional\ResourceTestBase::getExpectedGetIndividualResourceResponse()
Gets the expected individual ResourceResponse for GET.
Return value
\Drupal\jsonapi\ResourceResponse The expected individual ResourceResponse.
File
- tests/
src/ Functional/ ResourceTestBase.php, line 3219
Class
- ResourceTestBase
- Subclass this for every JSON:API resource type.
Namespace
Drupal\Tests\jsonapi\FunctionalCode
protected function getExpectedGetIndividualResourceResponse($status_code = 200) {
$resource_response = new ResourceResponse($this
->getExpectedDocument(), $status_code);
$cacheability = new CacheableMetadata();
$cacheability
->setCacheContexts($this
->getExpectedCacheContexts());
$cacheability
->setCacheTags($this
->getExpectedCacheTags());
return $resource_response
->addCacheableDependency($cacheability);
}