function FeedResourceTestBase::getExpectedNormalizedEntity

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

Overrides EntityResourceTestBase::getExpectedNormalizedEntity

1 call to FeedResourceTestBase::getExpectedNormalizedEntity()
FeedHalJsonTestBase::getExpectedNormalizedEntity in core/modules/hal/tests/src/Functional/aggregator/FeedHalJsonTestBase.php
Returns the expected normalization of the entity.
1 method overrides FeedResourceTestBase::getExpectedNormalizedEntity()
FeedHalJsonTestBase::getExpectedNormalizedEntity in core/modules/hal/tests/src/Functional/aggregator/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,
            ],
        ],
    ];
}

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