You are here

protected function ShapeItemTest::setUp in Drupal 9

Same name and namespace in other branches
  1. 8 core/modules/field/tests/src/Kernel/ShapeItemTest.php \Drupal\Tests\field\Kernel\ShapeItemTest::setUp()
  2. 10 core/modules/field/tests/src/Kernel/ShapeItemTest.php \Drupal\Tests\field\Kernel\ShapeItemTest::setUp()

Set the default field storage backend for fields created during tests.

Overrides FieldKernelTestBase::setUp

File

core/modules/field/tests/src/Kernel/ShapeItemTest.php, line 32

Class

ShapeItemTest
Tests the new entity API for the shape field type.

Namespace

Drupal\Tests\field\Kernel

Code

protected function setUp() : void {
  parent::setUp();

  // Create a 'shape' field and storage for validation.
  FieldStorageConfig::create([
    'field_name' => $this->fieldName,
    'entity_type' => 'entity_test',
    'type' => 'shape',
  ])
    ->save();
  FieldConfig::create([
    'entity_type' => 'entity_test',
    'field_name' => $this->fieldName,
    'bundle' => 'entity_test',
  ])
    ->save();
}