public function DateTest::testRenderItem in Views XML Backend 8
Same name in this branch
- 8 tests/src/Unit/Plugin/views/sort/DateTest.php \Drupal\Tests\views_xml_backend\Unit\Plugin\views\sort\DateTest::testRenderItem()
- 8 tests/src/Unit/Plugin/views/field/DateTest.php \Drupal\Tests\views_xml_backend\Unit\Plugin\views\field\DateTest::testRenderItem()
@covers ::query
File
- tests/
src/ Unit/ Plugin/ views/ sort/ DateTest.php, line 25 - Contains \Drupal\Tests\views_xml_backend\Unit\Plugin\views\sort\DateTest.
Class
- DateTest
- @coversDefaultClass \Drupal\views_xml_backend\Plugin\views\sort\Date @group views_xml_backend
Namespace
Drupal\Tests\views_xml_backend\Unit\Plugin\views\sortCode
public function testRenderItem() {
$plugin = new Date([], '', []);
$options = [
'id' => 'sorter_id',
'xpath_selector' => 'xpath_query',
];
$plugin
->init($this
->getMockedView(), $this
->getMockedDisplay(), $options);
$query = $this
->prophesize(Xml::class);
$query
->addField('sort_date_sorter_id', 'xpath_query')
->shouldBeCalled();
$query
->addSort(Argument::type(DateSorter::class))
->shouldBeCalled();
$plugin->query = $query
->reveal();
$plugin
->query();
}