You are here

protected function ZoneItemTest::setUp in Address 8

Overrides EntityKernelTestBase::setUp

File

tests/src/Kernel/ZoneItemTest.php, line 35

Class

ZoneItemTest
Tests the address_zone field.

Namespace

Drupal\Tests\address\Kernel

Code

protected function setUp() : void {
  parent::setUp();
  $field_storage = FieldStorageConfig::create([
    'field_name' => 'field_zone',
    'entity_type' => 'entity_test',
    'type' => 'address_zone',
    'cardinality' => 1,
  ]);
  $field_storage
    ->save();
  $field = FieldConfig::create([
    'field_name' => 'field_zone',
    'entity_type' => 'entity_test',
    'bundle' => 'entity_test',
  ]);
  $field
    ->save();
  $entity = EntityTest::create([
    'name' => 'Test',
  ]);
  $entity
    ->save();
  $this->testEntity = $entity;
}