public function ArgumentDateTimeTest::testDatetimeArgumentMonth in Zircon Profile 8
Same name and namespace in other branches
- 8.0 core/modules/datetime/src/Tests/Views/ArgumentDateTimeTest.php \Drupal\datetime\Tests\Views\ArgumentDateTimeTest::testDatetimeArgumentMonth()
Test month argument.
See also
\Drupal\datetime\Plugin\views\argument\MonthDate
File
- core/
modules/ datetime/ src/ Tests/ Views/ ArgumentDateTimeTest.php, line 74 - Contains \Drupal\datetime\Tests\Views\ArgumentDateTimeTest.
Class
- ArgumentDateTimeTest
- Tests the Drupal\datetime\Plugin\views\filter\Date handler.
Namespace
Drupal\datetime\Tests\ViewsCode
public function testDatetimeArgumentMonth() {
$view = Views::getView('test_argument_datetime');
// The 'embed_1' display has the 'month' argument.
$view
->setDisplay('embed_1');
$this
->executeView($view, [
'10',
]);
$expected = [];
$expected[] = [
'nid' => $this->nodes[0]
->id(),
];
$expected[] = [
'nid' => $this->nodes[1]
->id(),
];
$this
->assertIdenticalResultset($view, $expected, $this->map);
$view
->destroy();
$view
->setDisplay('embed_1');
$this
->executeView($view, [
'01',
]);
$expected = [];
$expected[] = [
'nid' => $this->nodes[2]
->id(),
];
$this
->assertIdenticalResultset($view, $expected, $this->map);
$view
->destroy();
}