public function SortTimestampIdTest::testLogTimestampIdAscSort in Log entity 2.x
Tests the sorting: Timestamp /ID ASC.
File
- tests/
src/ Kernel/ SortTimestampIdTest.php, line 91
Class
- SortTimestampIdTest
- Tests for Drupal\log\Plugin\views\sort\LogTimestampIdSort handler.
Namespace
Drupal\Tests\log\KernelCode
public function testLogTimestampIdAscSort() {
$view = Views::getView('log_test_view');
$view
->setDisplay();
$view->displayHandlers
->get('default')
->overrideOption('sorts', [
'timestamp' => [
'id' => 'timestamp',
'table' => 'log_field_data',
'field' => 'timestamp',
'relationship' => 'none',
'order' => 'ASC',
'plugin_id' => 'log_standard',
],
]);
$this
->executeView($view);
$this
->assertEqual(3, count($view->result), 'The number of returned rows match.');
$this
->assertIdenticalResultset($view, $this->expectedResultASC, [
'name' => 'name',
'id' => 'id',
], 'ASC sort displays as expected');
$view
->destroy();
unset($view);
}