Skip to content
Snippets Groups Projects
Verified Commit 3fd288da authored by Dave Long's avatar Dave Long
Browse files

Issue #3449891 by NexusNovaz, manish-31, bbrala: Move to new test path in NodeTest as per todo

(cherry picked from commit 11ce3c83)
parent d8a6f82e
No related branches found
No related tags found
No related merge requests found
......@@ -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']);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment