function ArgumentDateTest::testCreatedFullDateHandler

Same name in other branches
  1. 8.9.x core/modules/views/tests/src/Kernel/Handler/ArgumentDateTest.php \Drupal\Tests\views\Kernel\Handler\ArgumentDateTest::testCreatedFullDateHandler()
  2. 10 core/modules/views/tests/src/Kernel/Handler/ArgumentDateTest.php \Drupal\Tests\views\Kernel\Handler\ArgumentDateTest::testCreatedFullDateHandler()
  3. 11.x 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();
}

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