testGetIndividual example

// Repeat PATCH request: 200.     $response = $this->request('PATCH', $url$request_options);
    $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.
Home | Imprint | This part of the site doesn't use cookies.