You are here

protected function DateRecurBasicFormatterTest::setUp in Recurring Dates Field 3.0.x

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

Overrides KernelTestBase::setUp

File

tests/src/Kernel/DateRecurBasicFormatterTest.php, line 51

Class

DateRecurBasicFormatterTest
Tests date recur formatter.

Namespace

Drupal\Tests\date_recur\Kernel

Code

protected function setUp() : void {
  parent::setUp();
  $this
    ->installEntitySchema('dr_entity_test');
  $this->dateFormat = DateFormat::create([
    'id' => $this
      ->randomMachineName(),
    'pattern' => 'r',
  ]);
  $this->dateFormat
    ->save();
  $this->interpreter = DateRecurInterpreter::create([
    'id' => $this
      ->randomMachineName(),
    'plugin' => 'rl',
    'settings' => [
      'show_start_date' => TRUE,
      'show_until' => TRUE,
      'date_format' => $this->dateFormat
        ->id(),
      'show_infinite' => TRUE,
    ],
  ]);
  $this->interpreter
    ->save();
}