public function ArgumentDateTimeTest::testDatetimeArgumentWeek in Drupal 10
Same name and namespace in other branches
- 8 core/modules/datetime/tests/src/Kernel/Views/ArgumentDateTimeTest.php \Drupal\Tests\datetime\Kernel\Views\ArgumentDateTimeTest::testDatetimeArgumentWeek()
- 9 core/modules/datetime/tests/src/Kernel/Views/ArgumentDateTimeTest.php \Drupal\Tests\datetime\Kernel\Views\ArgumentDateTimeTest::testDatetimeArgumentWeek()
Tests week WW argument.
File
- core/
modules/ datetime/ tests/ src/ Kernel/ Views/ ArgumentDateTimeTest.php, line 168
Class
- ArgumentDateTimeTest
- Tests the Drupal\datetime\Plugin\views\filter\Date handler.
Namespace
Drupal\Tests\datetime\Kernel\ViewsCode
public function testDatetimeArgumentWeek() {
$view = Views::getView('test_argument_datetime');
// The 'embed_4' display has WW argument.
$view
->setDisplay('embed_4');
$this
->executeView($view, [
'41',
]);
$expected = [];
$expected[] = [
'nid' => $this->nodes[0]
->id(),
];
$expected[] = [
'nid' => $this->nodes[1]
->id(),
];
$this
->assertIdenticalResultset($view, $expected, $this->map);
$view
->destroy();
$view
->setDisplay('embed_4');
$this
->executeView($view, [
'01',
]);
$expected = [];
$expected[] = [
'nid' => $this->nodes[2]
->id(),
];
$expected[] = [
'nid' => $this->nodes[3]
->id(),
];
$this
->assertIdenticalResultset($view, $expected, $this->map);
$view
->destroy();
}