You are here

protected function IntervalItemTest::setUp in Interval Field 8

@inheritDoc

Overrides FieldKernelTestBase::setUp

File

tests/src/Kernel/IntervalItemTest.php, line 41

Class

IntervalItemTest
Defines a class for testing interval item.

Namespace

Drupal\Tests\interval\Kernel

Code

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

  // Create a field with settings to validate.
  $this->fieldStorage = FieldStorageConfig::create([
    'field_name' => 'field_interval',
    'type' => 'interval',
    'entity_type' => 'entity_test',
  ]);
  $this->fieldStorage
    ->save();
  $this->field = FieldConfig::create([
    'field_storage' => $this->fieldStorage,
    'bundle' => 'entity_test',
    'settings' => [
      'default_value' => 'blank',
    ],
  ]);
  $this->field
    ->save();
}