function ArgumentDateTest::testDayHandler

Same name and namespace in other branches
  1. 9 core/modules/views/tests/src/Kernel/Handler/ArgumentDateTest.php \Drupal\Tests\views\Kernel\Handler\ArgumentDateTest::testDayHandler()
  2. 8.9.x core/modules/views/tests/src/Kernel/Handler/ArgumentDateTest.php \Drupal\Tests\views\Kernel\Handler\ArgumentDateTest::testDayHandler()
  3. 11.x core/modules/views/tests/src/Kernel/Handler/ArgumentDateTest.php \Drupal\Tests\views\Kernel\Handler\ArgumentDateTest::testDayHandler()

Tests the Day handler.

See also

\Drupal\node\Plugin\views\argument\CreatedDay

File

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

Class

ArgumentDateTest
Tests the core date argument handlers.

Namespace

Drupal\Tests\views\Kernel\Handler

Code

public function testDayHandler() : void {
  $view = Views::getView('test_argument_date');
  $view->setDisplay('embed_1');
  $this->executeView($view, [
    '02',
  ]);
  $expected = [];
  $expected[] = [
    'id' => 2,
  ];
  $this->assertIdenticalResultset($view, $expected, $this->columnMap);
  $view->destroy();
  $view->setDisplay('embed_1');
  $this->executeView($view, [
    '01',
  ]);
  $expected = [];
  $expected[] = [
    'id' => 1,
  ];
  $expected[] = [
    'id' => 3,
  ];
  $expected[] = [
    'id' => 4,
  ];
  $expected[] = [
    'id' => 5,
  ];
  $this->assertIdenticalResultset($view, $expected, $this->columnMap);
  $view->destroy();
  $view->setDisplay('embed_1');
  $this->executeView($view, [
    '23',
  ]);
  $expected = [];
  $this->assertIdenticalResultset($view, $expected, $this->columnMap);
}

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