function ShortcutResourceTestBase::getExpectedNormalizedEntity

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

Overrides EntityResourceTestBase::getExpectedNormalizedEntity

File

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

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.