function LayoutBuilderEntityViewDisplayValidationTest::setUp
Same name in other branches
- 10 core/modules/layout_builder/tests/src/Kernel/LayoutBuilderEntityViewDisplayValidationTest.php \Drupal\Tests\layout_builder\Kernel\LayoutBuilderEntityViewDisplayValidationTest::setUp()
Overrides ConfigEntityValidationTestBase::setUp
File
-
core/
modules/ layout_builder/ tests/ src/ Kernel/ LayoutBuilderEntityViewDisplayValidationTest.php, line 39
Class
- LayoutBuilderEntityViewDisplayValidationTest
- Tests validation of Layout Builder's entity_view_display entities.
Namespace
Drupal\Tests\layout_builder\KernelCode
protected function setUp() : void {
parent::setUp();
$this->installConfig('node');
$this->createContentType([
'type' => 'one',
]);
$this->createContentType([
'type' => 'two',
]);
EntityTestBundle::create([
'id' => 'one',
])->save();
EntityTestBundle::create([
'id' => 'two',
])->save();
EntityViewMode::create([
'id' => 'node.layout',
'label' => 'Layout',
'targetEntityType' => 'node',
])->save();
$this->entity = $this->container
->get(EntityDisplayRepositoryInterface::class)
->getViewDisplay('node', 'one', 'layout');
$this->assertInstanceOf(LayoutBuilderEntityViewDisplay::class, $this->entity);
$this->entity
->save();
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.