function ItemResourceTestBase::getExpectedNormalizedEntity

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

Overrides EntityResourceTestBase::getExpectedNormalizedEntity

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

File

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

Class

ItemResourceTestBase
ResourceTestBase for Item entity.

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' => [
            $this->formatExpectedTimestampItemValues(123456789),
        ],
        'guid' => [],
    ];
}

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