You are here

protected function DateRecurFieldTest::setUp in Recurring Dates Field 3.x

Same name and namespace in other branches
  1. 8.2 tests/src/Kernel/DateRecurFieldTest.php \Drupal\Tests\date_recur\Kernel\DateRecurFieldTest::setUp()
  2. 3.0.x tests/src/Kernel/DateRecurFieldTest.php \Drupal\Tests\date_recur\Kernel\DateRecurFieldTest::setUp()
  3. 3.1.x tests/src/Kernel/DateRecurFieldTest.php \Drupal\Tests\date_recur\Kernel\DateRecurFieldTest::setUp()

Overrides KernelTestBase::setUp

File

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

Class

DateRecurFieldTest
Tests date_recur fields.

Namespace

Drupal\Tests\date_recur\Kernel

Code

protected function setUp() : void {
  parent::setUp();
  $this
    ->installEntitySchema('entity_test');
  $field_storage = FieldStorageConfig::create([
    'entity_type' => 'entity_test',
    'field_name' => 'foo',
    'type' => 'date_recur',
    'settings' => [
      'datetime_type' => DateRecurItem::DATETIME_TYPE_DATETIME,
    ],
  ]);
  $field_storage
    ->save();
  $field = [
    'field_name' => 'foo',
    'entity_type' => 'entity_test',
    'bundle' => 'entity_test',
  ];
  FieldConfig::create($field)
    ->save();
}