You are here

protected function FeedResourceTestBase::getExpectedNormalizedEntity in Drupal 9

Same name and namespace in other branches
  1. 8 core/modules/aggregator/tests/src/Functional/Rest/FeedResourceTestBase.php \Drupal\Tests\aggregator\Functional\Rest\FeedResourceTestBase::getExpectedNormalizedEntity()

Returns the expected normalization of the entity.

Return value

array

Overrides EntityResourceTestBase::getExpectedNormalizedEntity

See also

::createEntity()

1 call to FeedResourceTestBase::getExpectedNormalizedEntity()
FeedHalJsonTestBase::getExpectedNormalizedEntity in core/modules/aggregator/tests/src/Functional/Hal/FeedHalJsonTestBase.php
Returns the expected normalization of the entity.
1 method overrides FeedResourceTestBase::getExpectedNormalizedEntity()
FeedHalJsonTestBase::getExpectedNormalizedEntity in core/modules/aggregator/tests/src/Functional/Hal/FeedHalJsonTestBase.php
Returns the expected normalization of the entity.

File

core/modules/aggregator/tests/src/Functional/Rest/FeedResourceTestBase.php, line 73

Class

FeedResourceTestBase

Namespace

Drupal\Tests\aggregator\Functional\Rest

Code

protected function getExpectedNormalizedEntity() {
  return [
    'uuid' => [
      [
        'value' => 'abcdefg',
      ],
    ],
    'fid' => [
      [
        'value' => 1,
      ],
    ],
    'langcode' => [
      [
        'value' => 'en',
      ],
    ],
    'url' => [
      [
        'value' => 'http://example.com/rss.xml',
      ],
    ],
    'title' => [
      [
        'value' => 'Feed',
      ],
    ],
    'refresh' => [
      [
        'value' => 900,
      ],
    ],
    'checked' => [
      [
        'value' => (new \DateTime())
          ->setTimestamp(123456789)
          ->setTimezone(new \DateTimeZone('UTC'))
          ->format(\DateTime::RFC3339),
        'format' => \DateTime::RFC3339,
      ],
    ],
    'queued' => [
      [
        'value' => (new \DateTime())
          ->setTimestamp(123456789)
          ->setTimezone(new \DateTimeZone('UTC'))
          ->format(\DateTime::RFC3339),
        'format' => \DateTime::RFC3339,
      ],
    ],
    'link' => [
      [
        'value' => 'http://example.com',
      ],
    ],
    'description' => [
      [
        'value' => 'Feed Resource Test 1',
      ],
    ],
    'image' => [
      [
        'value' => 'http://example.com/feed_logo',
      ],
    ],
    'hash' => [
      [
        'value' => 'abcdefg',
      ],
    ],
    'etag' => [
      [
        'value' => 'hijklmn',
      ],
    ],
    'modified' => [
      [
        'value' => (new \DateTime())
          ->setTimestamp(123456789)
          ->setTimezone(new \DateTimeZone('UTC'))
          ->format(\DateTime::RFC3339),
        'format' => \DateTime::RFC3339,
      ],
    ],
  ];
}