Skip to content
Snippets Groups Projects

Issue #3449891: Removed old expected document and assertResourceResponse and...

Closed Issue #3449891: Removed old expected document and assertResourceResponse and...
1 file
+ 4
21
Compare changes
  • Side-by-side
  • Inline
@@ -338,34 +338,17 @@ public function testGetIndividual() {
// 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.
$expected_document = [
'jsonapi' => static::$jsonApiMember,
'errors' => [
[
'title' => 'Forbidden',
'status' => '403',
'detail' => 'The current user is not allowed to GET the selected resource.',
'links' => [
'info' => ['href' => HttpExceptionNormalizer::getInfoUrl(403)],
'via' => ['href' => $url->setAbsolute()->toString()],
],
'source' => [
'pointer' => '/data',
],
],
],
];
$this->assertResourceResponse(
$this->assertResourceErrorResponse(
403,
$expected_document,
'The current user is not allowed to GET the selected resource.',
$url,
$response,
'/data',
['4xx-response', 'http_response', 'node:1'],
['url.query_args:resourceVersion', 'url.site', 'user.permissions'],
FALSE,
'MISS'
);
/* $this->assertResourceErrorResponse(403, 'The current user is not allowed to GET the selected resource.', $response, '/data'); */
// 200 after granting permission.
$this->grantPermissionsToTestedRole(['view own unpublished content']);
Loading