You are here

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

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

Parameters

bool $import_test_views: Should the views specified on the test class be imported. If you need to setup some additional stuff, like fields, you need to call false and then call createTestViews for your own.

Overrides ViewsKernelTestBase::setUp

1 call to DateRecurViewsOccurrenceFilterTest::setUp()
DateRecurViewsOccurrenceFilterAttachedTest::setUp in tests/src/Kernel/DateRecurViewsOccurrenceFilterAttachedTest.php
1 method overrides DateRecurViewsOccurrenceFilterTest::setUp()
DateRecurViewsOccurrenceFilterAttachedTest::setUp in tests/src/Kernel/DateRecurViewsOccurrenceFilterAttachedTest.php

File

tests/src/Kernel/DateRecurViewsOccurrenceFilterTest.php, line 58

Class

DateRecurViewsOccurrenceFilterTest
Tests the results of 'date_recur_occurrences_filter' filter plugin.

Namespace

Drupal\Tests\date_recur\Kernel

Code

protected function setUp($import_test_views = TRUE) {
  parent::setUp(FALSE);
  $this
    ->installEntitySchema('dr_entity_test');
  ViewTestData::createTestViews(get_class($this), [
    'date_recur_views_test',
  ]);
  $this->map = [
    'id' => 'id',
  ];

  // This is the name of the pre-installed base field.
  $this->fieldName = 'dr';
  $user = User::create([
    'uid' => 2,
    'timezone' => 'Australia/Sydney',
  ]);
  $this->container
    ->get('current_user')
    ->setAccount($user);
}