function DateArgumentDefaultTest::setUp

Overrides NodeTestBase::setUp

File

core/modules/node/tests/src/Functional/Views/DateArgumentDefaultTest.php, line 76

Class

DateArgumentDefaultTest
Tests pluggable argument_default for views.

Namespace

Drupal\Tests\node\Functional\Views

Code

public function setUp($import_test_views = TRUE, $modules = [
  'node_test_views',
]) : void {
  parent::setUp($import_test_views, $modules);
  $this->drupalCreateContentType([
    'type' => 'page',
  ]);
  $this->currentNode = $this->drupalCreateNode([
    'type' => 'page',
  ]);
  $this->sameTimeNode = $this->drupalCreateNode([
    'type' => 'page',
  ]);
  $this->otherTimeNode = $this->drupalCreateNode([
    'type' => 'page',
    'created' => strtotime('-5 days'),
    'changed' => strtotime('-5 days'),
  ]);
  $this->fixedTimeNode = $this->drupalCreateNode([
    'type' => 'page',
    'created' => strtotime('1975-05-18'),
    'changed' => strtotime('1975-05-18'),
  ]);
  $this->sameMonthNode = $this->drupalCreateNode([
    'type' => 'page',
    'created' => strtotime('1975-05-13'),
    'changed' => strtotime('1975-05-13'),
  ]);
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.