function FieldKernelTestBase::setUp
Same name and namespace in other branches
- 11.x core/modules/field/tests/src/Kernel/FieldKernelTestBase.php \Drupal\Tests\field\Kernel\FieldKernelTestBase::setUp()
- 10 core/modules/field/tests/src/Kernel/FieldKernelTestBase.php \Drupal\Tests\field\Kernel\FieldKernelTestBase::setUp()
- 8.9.x core/modules/field/tests/src/Kernel/FieldKernelTestBase.php \Drupal\Tests\field\Kernel\FieldKernelTestBase::setUp()
Set the default field storage backend for fields created during tests.
4 methods override FieldKernelTestBase::setUp()
- DateTimeItemTest::setUp in core/
modules/ datetime/ tests/ src/ Kernel/ DateTimeItemTest.php - Set the default field storage backend for fields created during tests.
- FieldCrudTest::setUp in core/
modules/ field/ tests/ src/ Kernel/ FieldCrudTest.php - Set the default field storage backend for fields created during tests.
- FieldDataCountTest::setUp in core/
modules/ field/ tests/ src/ Kernel/ FieldDataCountTest.php - Set the default field storage backend for fields created during tests.
- LinkItemTest::setUp in core/
modules/ link/ tests/ src/ Kernel/ LinkItemTest.php - Set the default field storage backend for fields created during tests.
File
-
core/
modules/ field/ tests/ src/ Kernel/ FieldKernelTestBase.php, line 55
Class
- FieldKernelTestBase
- Parent class for Field API unit tests.
Namespace
Drupal\Tests\field\KernelCode
protected function setUp() {
parent::setUp();
$this->fieldTestData = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS);
$this->installEntitySchema('entity_test');
$this->installEntitySchema('user');
$this->installSchema('system', [
'sequences',
]);
// Set default storage backend and configure the theme system.
$this->installConfig([
'field',
'system',
]);
// Create user 1.
$storage = \Drupal::entityTypeManager()->getStorage('user');
$storage->create([
'uid' => 1,
'name' => 'entity-test',
'mail' => 'entity@localhost',
'status' => TRUE,
])
->save();
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.