function NumberItemTest::setUp
Same name in other branches
- 8.9.x core/modules/field/tests/src/Kernel/Number/NumberItemTest.php \Drupal\Tests\field\Kernel\Number\NumberItemTest::setUp()
- 10 core/modules/field/tests/src/Kernel/Number/NumberItemTest.php \Drupal\Tests\field\Kernel\Number\NumberItemTest::setUp()
- 11.x core/modules/field/tests/src/Kernel/Number/NumberItemTest.php \Drupal\Tests\field\Kernel\Number\NumberItemTest::setUp()
Overrides FieldKernelTestBase::setUp
File
-
core/
modules/ field/ tests/ src/ Kernel/ Number/ NumberItemTest.php, line 29
Class
- NumberItemTest
- Tests the new entity API for the number field type.
Namespace
Drupal\Tests\field\Kernel\NumberCode
protected function setUp() : void {
parent::setUp();
// Create number field storages and fields for validation.
foreach ([
'integer',
'float',
'decimal',
] as $type) {
FieldStorageConfig::create([
'entity_type' => 'entity_test',
'field_name' => 'field_' . $type,
'type' => $type,
])->save();
FieldConfig::create([
'entity_type' => 'entity_test',
'field_name' => 'field_' . $type,
'bundle' => 'entity_test',
])->save();
}
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.