You are here

protected function LayoutBuilderEntityViewDisplayTest::getExpectedDocument in Drupal 10

Same name and namespace in other branches
  1. 8 core/modules/layout_builder/tests/src/Functional/Jsonapi/LayoutBuilderEntityViewDisplayTest.php \Drupal\Tests\layout_builder\Functional\Jsonapi\LayoutBuilderEntityViewDisplayTest::getExpectedDocument()
  2. 9 core/modules/layout_builder/tests/src/Functional/Jsonapi/LayoutBuilderEntityViewDisplayTest.php \Drupal\Tests\layout_builder\Functional\Jsonapi\LayoutBuilderEntityViewDisplayTest::getExpectedDocument()

Returns the expected JSON:API document for the entity.

Return value

array A JSON:API response document.

Overrides EntityViewDisplayTest::getExpectedDocument

See also

::createEntity()

File

core/modules/layout_builder/tests/src/Functional/Jsonapi/LayoutBuilderEntityViewDisplayTest.php, line 43

Class

LayoutBuilderEntityViewDisplayTest
JSON:API integration test for the "EntityViewDisplay" config entity type.

Namespace

Drupal\Tests\layout_builder\Functional\Jsonapi

Code

protected function getExpectedDocument() {
  $document = parent::getExpectedDocument();
  array_unshift($document['data']['attributes']['dependencies']['module'], 'layout_builder');
  $document['data']['attributes']['hidden'][OverridesSectionStorage::FIELD_NAME] = TRUE;
  $document['data']['attributes']['third_party_settings']['layout_builder'] = [
    'enabled' => TRUE,
    'allow_custom' => TRUE,
  ];
  return $document;
}