You are here

protected function FieldKernelTestBase::setUp in Drupal 8

Same name and namespace in other branches
  1. 9 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.

Overrides KernelTestBase::setUp

32 calls to FieldKernelTestBase::setUp()
BooleanItemTest::setUp in core/modules/field/tests/src/Kernel/Boolean/BooleanItemTest.php
Set the default field storage backend for fields created during tests.
BulkDeleteTest::setUp in core/modules/field/tests/src/Kernel/BulkDeleteTest.php
Set the default field storage backend for fields created during tests.
CommentItemTest::setUp in core/modules/comment/tests/src/Kernel/CommentItemTest.php
Set the default field storage backend for fields created during tests.
ConfigFieldDefinitionTest::setUp in core/modules/field/tests/src/Kernel/ConfigFieldDefinitionTest.php
Set the default field storage backend for fields created during tests.
DateRangeItemTest::setUp in core/modules/datetime_range/tests/src/Kernel/DateRangeItemTest.php
Set the default field storage backend for fields created during tests.

... See full list

32 methods override FieldKernelTestBase::setUp()
BooleanItemTest::setUp in core/modules/field/tests/src/Kernel/Boolean/BooleanItemTest.php
Set the default field storage backend for fields created during tests.
BulkDeleteTest::setUp in core/modules/field/tests/src/Kernel/BulkDeleteTest.php
Set the default field storage backend for fields created during tests.
CommentItemTest::setUp in core/modules/comment/tests/src/Kernel/CommentItemTest.php
Set the default field storage backend for fields created during tests.
ConfigFieldDefinitionTest::setUp in core/modules/field/tests/src/Kernel/ConfigFieldDefinitionTest.php
Set the default field storage backend for fields created during tests.
DateRangeItemTest::setUp in core/modules/datetime_range/tests/src/Kernel/DateRangeItemTest.php
Set the default field storage backend for fields created during tests.

... See full list

File

core/modules/field/tests/src/Kernel/FieldKernelTestBase.php, line 50

Class

FieldKernelTestBase
Parent class for Field API unit tests.

Namespace

Drupal\Tests\field\Kernel

Code

protected function setUp() {
  parent::setUp();
  $this->fieldTestData = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS);
  $this
    ->installEntitySchema('entity_test');
  $this
    ->installEntitySchema('user');
  $this
    ->installSchema('system', [
    'sequences',
    'key_value',
  ]);

  // 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();
}