You are here

protected function ShortcutResourceTestBase::getExpectedNormalizedEntity in Drupal 9

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. 10 core/modules/shortcut/tests/src/Functional/Rest/ShortcutResourceTestBase.php \Drupal\Tests\shortcut\Functional\Rest\ShortcutResourceTestBase::getExpectedNormalizedEntity()

Returns the expected normalization of the entity.

Return value

array

Overrides EntityResourceTestBase::getExpectedNormalizedEntity

See also

::createEntity()

1 call to ShortcutResourceTestBase::getExpectedNormalizedEntity()
ShortcutHalJsonAnonTest::getExpectedNormalizedEntity in core/modules/shortcut/tests/src/Functional/Hal/ShortcutHalJsonAnonTest.php
Returns the expected normalization of the entity.
1 method overrides ShortcutResourceTestBase::getExpectedNormalizedEntity()
ShortcutHalJsonAnonTest::getExpectedNormalizedEntity in core/modules/shortcut/tests/src/Functional/Hal/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,
      ],
    ],
  ];
}