function ShortcutResourceTestBase::getExpectedNormalizedEntity

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

Overrides EntityResourceTestBase::getExpectedNormalizedEntity

1 call to ShortcutResourceTestBase::getExpectedNormalizedEntity()
ShortcutHalJsonAnonTest::getExpectedNormalizedEntity in core/modules/hal/tests/src/Functional/shortcut/ShortcutHalJsonAnonTest.php
Returns the expected normalization of the entity.
1 method overrides ShortcutResourceTestBase::getExpectedNormalizedEntity()
ShortcutHalJsonAnonTest::getExpectedNormalizedEntity in core/modules/hal/tests/src/Functional/shortcut/ShortcutHalJsonAnonTest.php
Returns the expected normalization of the entity.

File

core/modules/shortcut/tests/src/Functional/Rest/ShortcutResourceTestBase.php, line 74

Class

ShortcutResourceTestBase
ResourceTestBase for Shortcut entity.

Namespace

Drupal\Tests\shortcut\Functional\Rest

Code

protected function getExpectedNormalizedEntity() {
    return [
        'uuid' => [
            [
                'value' => $this->entity
                    ->uuid(),
            ],
        ],
        'id' => [
            [
                'value' => (int) $this->entity
                    ->id(),
            ],
        ],
        'title' => [
            [
                'value' => 'Comments',
            ],
        ],
        'shortcut_set' => [
            [
                'target_id' => 'default',
                'target_type' => 'shortcut_set',
                'target_uuid' => ShortcutSet::load('default')->uuid(),
            ],
        ],
        'link' => [
            [
                'uri' => 'internal:/admin/content/comment',
                'title' => NULL,
                'options' => [
                    'fragment' => 'new',
                ],
            ],
        ],
        'weight' => [
            [
                'value' => -20,
            ],
        ],
        'langcode' => [
            [
                'value' => 'en',
            ],
        ],
        'default_langcode' => [
            [
                'value' => TRUE,
            ],
        ],
    ];
}

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