You are here

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

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

Overrides DateRecurOccurrenceTableTest::setUp

File

tests/src/Kernel/DateRecurOccurrenceTableAttachedTest.php, line 22

Class

DateRecurOccurrenceTableAttachedTest
Tests occurrence tables values.

Namespace

Drupal\Tests\date_recur\Kernel

Code

protected function setUp() : void {
  parent::setUp();
  $this->testEntityType = 'entity_test_rev';
  $this
    ->installEntitySchema($this->testEntityType);
  $fieldStorage = FieldStorageConfig::create([
    'entity_type' => $this->testEntityType,
    'field_name' => 'abc',
    'type' => 'date_recur',
    'settings' => [
      'datetime_type' => DateRecurItem::DATETIME_TYPE_DATETIME,
    ],
  ]);
  $fieldStorage
    ->save();
  $this->fieldDefinition = $fieldStorage;
  $this->fieldName = 'abc';
  $fieldConfig = FieldConfig::create([
    'field_name' => 'abc',
    'entity_type' => $this->testEntityType,
    'bundle' => $this->testEntityType,
    'settings' => [],
  ]);
  $fieldConfig
    ->save();
}