You are here

public function ArgumentDateTest::testCreatedFullDateHandler in Drupal 9

Same name and namespace in other branches
  1. 8 core/modules/views/tests/src/Kernel/Handler/ArgumentDateTest.php \Drupal\Tests\views\Kernel\Handler\ArgumentDateTest::testCreatedFullDateHandler()

Tests the CreatedFullDate handler.

See also

\Drupal\node\Plugin\views\argument\CreatedFullDate

File

core/modules/views/tests/src/Kernel/Handler/ArgumentDateTest.php, line 59

Class

ArgumentDateTest
Tests the core date argument handlers.

Namespace

Drupal\Tests\views\Kernel\Handler

Code

public function testCreatedFullDateHandler() {
  $view = Views::getView('test_argument_date');
  $view
    ->setDisplay('default');
  $this
    ->executeView($view, [
    '20000102',
  ]);
  $expected = [];
  $expected[] = [
    'id' => 2,
  ];
  $this
    ->assertIdenticalResultset($view, $expected, $this->columnMap);
  $view
    ->destroy();
  $view
    ->setDisplay('default');
  $this
    ->executeView($view, [
    '20000101',
  ]);
  $expected = [];
  $expected[] = [
    'id' => 1,
  ];
  $expected[] = [
    'id' => 3,
  ];
  $expected[] = [
    'id' => 4,
  ];
  $expected[] = [
    'id' => 5,
  ];
  $this
    ->assertIdenticalResultset($view, $expected, $this->columnMap);
  $view
    ->destroy();
  $view
    ->setDisplay('default');
  $this
    ->executeView($view, [
    '20001023',
  ]);
  $expected = [];
  $this
    ->assertIdenticalResultset($view, $expected, $this->columnMap);
  $view
    ->destroy();
}