function ItemResourceTestBase::getExpectedNormalizedEntity

File

core/modules/aggregator/tests/src/Functional/Rest/ItemResourceTestBase.php, line 96

Class

ItemResourceTestBase
ResourceTestBase for Item entity. @group legacy

Namespace

Drupal\Tests\aggregator\Functional\Rest

Code

protected function getExpectedNormalizedEntity() {
  $feed = Feed::load($this->entity
    ->getFeedId());
  return [
    'iid' => [
      [
        'value' => 1,
      ],
    ],
    'langcode' => [
      [
        'value' => 'en',
      ],
    ],
    'fid' => [
      [
        'target_id' => 1,
        'target_type' => 'aggregator_feed',
        'target_uuid' => $feed->uuid(),
        'url' => base_path() . 'aggregator/sources/1',
      ],
    ],
    'title' => [
      [
        'value' => 'Llama',
      ],
    ],
    'link' => [
      [
        'value' => 'https://www.drupal.org/',
      ],
    ],
    'author' => [],
    'description' => [],
    'timestamp' => [
      [
        'value' => (new \DateTime())->setTimestamp(123456789)
          ->setTimezone(new \DateTimeZone('UTC'))
          ->format(\DateTime::RFC3339),
        'format' => \DateTime::RFC3339,
      ],
    ],
    'guid' => [],
  ];
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.