function ContentTranslationUntranslatableFieldsTest::setupTestFields
Same name in other branches
- 9 core/modules/content_translation/tests/src/Functional/ContentTranslationUntranslatableFieldsTest.php \Drupal\Tests\content_translation\Functional\ContentTranslationUntranslatableFieldsTest::setupTestFields()
- 10 core/modules/content_translation/tests/src/Functional/ContentTranslationUntranslatableFieldsTest.php \Drupal\Tests\content_translation\Functional\ContentTranslationUntranslatableFieldsTest::setupTestFields()
- 11.x core/modules/content_translation/tests/src/Functional/ContentTranslationUntranslatableFieldsTest.php \Drupal\Tests\content_translation\Functional\ContentTranslationUntranslatableFieldsTest::setupTestFields()
Overrides ContentTranslationTestBase::setupTestFields
File
-
core/
modules/ content_translation/ tests/ src/ Functional/ ContentTranslationUntranslatableFieldsTest.php, line 50
Class
- ContentTranslationUntranslatableFieldsTest
- Tests the untranslatable fields behaviors.
Namespace
Drupal\Tests\content_translation\FunctionalCode
protected function setupTestFields() {
parent::setupTestFields();
$field_storage = FieldStorageConfig::create([
'field_name' => 'field_multilingual',
'type' => 'test_field',
'entity_type' => $this->entityTypeId,
'cardinality' => 1,
]);
$field_storage->save();
FieldConfig::create([
'field_storage' => $field_storage,
'bundle' => $this->bundle,
'label' => 'Untranslatable-but-visible test field',
'translatable' => FALSE,
])
->save();
\Drupal::service('entity_display.repository')->getFormDisplay($this->entityTypeId, $this->bundle, 'default')
->setComponent('field_multilingual', [
'type' => 'test_field_widget_multilingual',
])
->save();
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.