protected function TranslatableFieldTest::setUp in Drupal 10
Same name and namespace in other branches
- 8 core/modules/layout_builder/tests/src/Kernel/TranslatableFieldTest.php \Drupal\Tests\layout_builder\Kernel\TranslatableFieldTest::setUp()
- 9 core/modules/layout_builder/tests/src/Kernel/TranslatableFieldTest.php \Drupal\Tests\layout_builder\Kernel\TranslatableFieldTest::setUp()
File
- core/
modules/ layout_builder/ tests/ src/ Kernel/ TranslatableFieldTest.php, line 38
Class
- TranslatableFieldTest
- Tests Layout Builder with a translatable layout field.
Namespace
Drupal\Tests\layout_builder\KernelCode
protected function setUp() : void {
parent::setUp();
$this
->installEntitySchema('entity_test');
// Create a translation.
ConfigurableLanguage::createFromLangcode('es')
->save();
LayoutBuilderEntityViewDisplay::create([
'targetEntityType' => 'entity_test',
'bundle' => 'entity_test',
'mode' => 'default',
'status' => TRUE,
])
->enableLayoutBuilder()
->setOverridable()
->save();
FieldStorageConfig::loadByName('entity_test', OverridesSectionStorage::FIELD_NAME)
->setTranslatable(TRUE)
->save();
FieldConfig::loadByName('entity_test', 'entity_test', OverridesSectionStorage::FIELD_NAME)
->setTranslatable(TRUE)
->save();
}