LayoutBuilderEntityViewDisplayResourceTestBase.php in Drupal 9
File
core/modules/layout_builder/tests/src/Functional/Rest/LayoutBuilderEntityViewDisplayResourceTestBase.php
View source
<?php
namespace Drupal\Tests\layout_builder\Functional\Rest;
use Drupal\FunctionalTests\Rest\EntityViewDisplayResourceTestBase;
use Drupal\layout_builder\Plugin\SectionStorage\OverridesSectionStorage;
abstract class LayoutBuilderEntityViewDisplayResourceTestBase extends EntityViewDisplayResourceTestBase {
protected static $modules = [
'layout_builder',
];
protected function createEntity() {
$entity = parent::createEntity();
$entity
->enableLayoutBuilder()
->setOverridable()
->save();
$this
->assertCount(1, $entity
->getThirdPartySetting('layout_builder', 'sections'));
return $entity;
}
protected function getExpectedNormalizedEntity() {
$expected = parent::getExpectedNormalizedEntity();
array_unshift($expected['dependencies']['module'], 'layout_builder');
$expected['hidden'][OverridesSectionStorage::FIELD_NAME] = TRUE;
$expected['third_party_settings']['layout_builder'] = [
'enabled' => TRUE,
'allow_custom' => TRUE,
];
return $expected;
}
}