You are here

public function MonthDatePluginTest::setUp in Drupal 8

Same name and namespace in other branches
  1. 9 core/modules/views/tests/src/Functional/Plugin/MonthDatePluginTest.php \Drupal\Tests\views\Functional\Plugin\MonthDatePluginTest::setUp()

Overrides ViewTestBase::setUp

File

core/modules/views/tests/src/Functional/Plugin/MonthDatePluginTest.php, line 51

Class

MonthDatePluginTest
Tests the Month Date Plugin.

Namespace

Drupal\Tests\views\Functional\Plugin

Code

public function setUp($import_test_views = TRUE) {
  parent::setUp($import_test_views);
  $utc = new \DateTimeZone('UTC');
  $format = 'Y-m-d h:i:s';
  $this->node1 = $this
    ->drupalCreateNode([
    'created' => \DateTime::createFromFormat($format, '2020-10-01 00:00:00', $utc)
      ->getTimestamp(),
  ]);
  $this->node2 = $this
    ->drupalCreateNode([
    'created' => \DateTime::createFromFormat($format, '2020-11-01 00:00:00', $utc)
      ->getTimestamp(),
  ]);
}