public function ArgumentDateTest::testCreatedFullDateHandler

Tests the CreatedFullDate handler.

See also

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

File

drupal/core/modules/views/lib/Drupal/views/Tests/Handler/ArgumentDateTest.php, line 70
Contains \Drupal\views\Tests\Handler\ArgumentDateTest.

Class

ArgumentDateTest
Tests the core date argument handlers.

Namespace

Drupal\views\Tests\Handler

Code

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