You are here

public function ArgumentDateTest::testMonthHandler in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/views/src/Tests/Handler/ArgumentDateTest.php \Drupal\views\Tests\Handler\ArgumentDateTest::testMonthHandler()

Tests the Month handler.

See also

\Drupal\node\Plugin\views\argument\CreatedMonth

File

core/modules/views/src/Tests/Handler/ArgumentDateTest.php, line 125
Contains \Drupal\views\Tests\Handler\ArgumentDateTest.

Class

ArgumentDateTest
Tests the core date argument handlers.

Namespace

Drupal\views\Tests\Handler

Code

public function testMonthHandler() {
  $view = Views::getView('test_argument_date');
  $view
    ->setDisplay('embed_2');
  $this
    ->executeView($view, array(
    '01',
  ));
  $expected = array();
  $expected[] = array(
    'id' => 1,
  );
  $expected[] = array(
    'id' => 2,
  );
  $expected[] = array(
    'id' => 3,
  );
  $expected[] = array(
    'id' => 4,
  );
  $expected[] = array(
    'id' => 5,
  );
  $this
    ->assertIdenticalResultset($view, $expected, $this->columnMap);
  $view
    ->destroy();
  $view
    ->setDisplay('embed_2');
  $this
    ->executeView($view, array(
    '12',
  ));
  $expected = array();
  $this
    ->assertIdenticalResultset($view, $expected, $this->columnMap);
}