You are here

public function ArgumentDateTimeTest::setUp in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/datetime/src/Tests/Views/ArgumentDateTimeTest.php \Drupal\datetime\Tests\Views\ArgumentDateTimeTest::setUp()

Sets up a Drupal site for running functional and integration tests.

Installs Drupal with the installation profile specified in \Drupal\simpletest\WebTestBase::$profile into the prefixed database.

Afterwards, installs any additional modules specified in the static \Drupal\simpletest\WebTestBase::$modules property of each class in the class hierarchy.

After installation all caches are flushed and several configuration values are reset to the values of the parent site executing the test, since the default values may be incompatible with the environment in which tests are being executed.

Overrides DateTimeHandlerTestBase::setUp

File

core/modules/datetime/src/Tests/Views/ArgumentDateTimeTest.php, line 27
Contains \Drupal\datetime\Tests\Views\ArgumentDateTimeTest.

Class

ArgumentDateTimeTest
Tests the Drupal\datetime\Plugin\views\filter\Date handler.

Namespace

Drupal\datetime\Tests\Views

Code

public function setUp() {
  parent::setUp();

  // Add some basic test nodes.
  $dates = [
    '2000-10-10',
    '2001-10-10',
    '2002-01-01',
  ];
  foreach ($dates as $date) {
    $this->nodes[] = $this
      ->drupalCreateNode([
      'field_date' => [
        'value' => $date,
      ],
    ]);
  }
}