function MultiCardinalitySpineTest::setUp
Same name and namespace in other branches
- 11.x core/tests/Drupal/KernelTests/Core/Entity/MultiCardinalitySpineTest.php \Drupal\KernelTests\Core\Entity\MultiCardinalitySpineTest::setUp()
Creates three unlimited fields on entity_test_mulrev, two translatable.
File
-
core/
tests/ Drupal/ KernelTests/ Core/ Entity/ MultiCardinalitySpineTest.php, line 29
Class
- MultiCardinalitySpineTest
- Checks loading several multilingual multiple cardinality fields at once.
Namespace
Drupal\KernelTests\Core\EntityCode
protected function setUp() : void {
parent::setUp();
$this->installEntitySchema('entity_test_mulrev');
ConfigurableLanguage::createFromLangcode('de')->save();
foreach ([
'a' => TRUE,
'b' => TRUE,
'c' => FALSE,
] as $name => $translatable) {
FieldStorageConfig::create([
'field_name' => "field_{$name}",
'entity_type' => 'entity_test_mulrev',
'type' => 'integer',
'cardinality' => -1,
])->save();
FieldConfig::create([
'field_name' => "field_{$name}",
'entity_type' => 'entity_test_mulrev',
'bundle' => 'entity_test_mulrev',
'translatable' => $translatable,
])->save();
}
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.