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
Loading
Loading
Loading
Loading
Loading
+4 −21
Original line number Diff line number Diff line
@@ -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']);