function MenuLinkContentResourceTestBase::getExpectedNormalizedEntity

Same name in other branches
  1. 9 core/modules/menu_link_content/tests/src/Functional/Rest/MenuLinkContentResourceTestBase.php \Drupal\Tests\menu_link_content\Functional\Rest\MenuLinkContentResourceTestBase::getExpectedNormalizedEntity()
  2. 8.9.x core/modules/menu_link_content/tests/src/Functional/Rest/MenuLinkContentResourceTestBase.php \Drupal\Tests\menu_link_content\Functional\Rest\MenuLinkContentResourceTestBase::getExpectedNormalizedEntity()
  3. 10 core/modules/menu_link_content/tests/src/Functional/Rest/MenuLinkContentResourceTestBase.php \Drupal\Tests\menu_link_content\Functional\Rest\MenuLinkContentResourceTestBase::getExpectedNormalizedEntity()

Overrides EntityResourceTestBase::getExpectedNormalizedEntity

File

core/modules/menu_link_content/tests/src/Functional/Rest/MenuLinkContentResourceTestBase.php, line 110

Class

MenuLinkContentResourceTestBase
ResourceTestBase for MenuLinkContent entity.

Namespace

Drupal\Tests\menu_link_content\Functional\Rest

Code

protected function getExpectedNormalizedEntity() {
    return [
        'uuid' => [
            [
                'value' => $this->entity
                    ->uuid(),
            ],
        ],
        'id' => [
            [
                'value' => 1,
            ],
        ],
        'revision_id' => [
            [
                'value' => 1,
            ],
        ],
        'title' => [
            [
                'value' => 'Llama Gabilondo',
            ],
        ],
        'link' => [
            [
                'uri' => 'https://nl.wikipedia.org/wiki/Llama',
                'title' => NULL,
                'options' => [
                    'fragment' => 'a-fragment',
                    'attributes' => [
                        'class' => [
                            'example-class',
                        ],
                    ],
                ],
            ],
        ],
        'weight' => [
            [
                'value' => 0,
            ],
        ],
        'menu_name' => [
            [
                'value' => 'main',
            ],
        ],
        'langcode' => [
            [
                'value' => 'en',
            ],
        ],
        'bundle' => [
            [
                'value' => 'menu_link_content',
            ],
        ],
        'description' => [
            [
                'value' => 'Llama Gabilondo',
            ],
        ],
        'external' => [
            [
                'value' => FALSE,
            ],
        ],
        'rediscover' => [
            [
                'value' => FALSE,
            ],
        ],
        'expanded' => [
            [
                'value' => FALSE,
            ],
        ],
        'enabled' => [
            [
                'value' => TRUE,
            ],
        ],
        'changed' => [
            [
                'value' => (new \DateTime())->setTimestamp($this->entity
                    ->getChangedTime())
                    ->setTimezone(new \DateTimeZone('UTC'))
                    ->format(\DateTime::RFC3339),
                'format' => \DateTime::RFC3339,
            ],
        ],
        'default_langcode' => [
            [
                'value' => TRUE,
            ],
        ],
        'parent' => [],
        'revision_created' => [
            [
                'value' => (new \DateTime())->setTimestamp((int) $this->entity
                    ->getRevisionCreationTime())
                    ->setTimezone(new \DateTimeZone('UTC'))
                    ->format(\DateTime::RFC3339),
                'format' => \DateTime::RFC3339,
            ],
        ],
        'revision_user' => [],
        'revision_log_message' => [],
        'revision_translation_affected' => [
            [
                'value' => TRUE,
            ],
        ],
    ];
}

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