You are here

protected function HistoryTimestampTest::setUp in Drupal 9

Same name and namespace in other branches
  1. 8 core/modules/history/tests/src/Kernel/Views/HistoryTimestampTest.php \Drupal\Tests\history\Kernel\Views\HistoryTimestampTest::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

File

core/modules/history/tests/src/Kernel/Views/HistoryTimestampTest.php, line 37

Class

HistoryTimestampTest
Tests the history timestamp handlers.

Namespace

Drupal\Tests\history\Kernel\Views

Code

protected function setUp($import_test_views = TRUE) : void {
  parent::setUp($import_test_views);
  $this
    ->installEntitySchema('node');
  $this
    ->installEntitySchema('user');
  $this
    ->installSchema('history', [
    'history',
  ]);

  // Use classy theme because its marker is wrapped in a span so it can be
  // easily targeted with xpath.
  \Drupal::service('theme_installer')
    ->install([
    'classy',
  ]);
  \Drupal::theme()
    ->setActiveTheme(\Drupal::service('theme.initialization')
    ->initTheme('classy'));
}