You are here

protected function ShortcutResourceTestBase::getExpectedNormalizedEntity in Drupal 10

Same name and namespace in other branches
  1. 8 core/modules/shortcut/tests/src/Functional/Rest/ShortcutResourceTestBase.php \Drupal\Tests\shortcut\Functional\Rest\ShortcutResourceTestBase::getExpectedNormalizedEntity()
  2. 9 core/modules/shortcut/tests/src/Functional/Rest/ShortcutResourceTestBase.php \Drupal\Tests\shortcut\Functional\Rest\ShortcutResourceTestBase::getExpectedNormalizedEntity()

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,
      ],
    ],
  ];
}