$this->
assertResourceResponse(200, FALSE,
$response);
$updated_normalization = Json::
decode((string) $response->
getBody());
$this->
assertSame($normalization['data'
]['attributes'
]['path'
]['alias'
],
$updated_normalization['data'
]['attributes'
]['path'
]['alias'
]);
} /**
* {@inheritdoc}
*/
public function testGetIndividual() { parent::
testGetIndividual();
$this->
assertCacheableNormalizations();
// Unpublish node.
$this->entity->
setUnpublished()->
save();
// @todo Remove line below in favor of commented line in https://www.drupal.org/project/drupal/issues/2878463.
$url = Url::
fromRoute(sprintf('jsonapi.%s.individual',
static::
$resourceTypeName),
['entity' =>
$this->entity->
uuid()]);
// $url = $this->entity->toUrl('jsonapi');
$request_options =
$this->
getAuthenticationRequestOptions();
// 403 when accessing own unpublished node.
$response =
$this->
request('GET',
$url,
$request_options);
// @todo Remove $expected + assertResourceResponse() in favor of the commented line below once https://www.drupal.org/project/drupal/issues/2943176 lands.