public function testTable() { $view = Views::
getView('test_table'
);
$view->
setDisplay('default'
);
$view->
initStyle();
$view->
initHandlers();
$view->
initQuery();
$style_plugin =
$view->style_plugin;
// Test the buildSort() method.
$request =
new Request();
$view->
setRequest($request);
$style_plugin->options
['override'
] = FALSE;
$style_plugin->options
['default'
] = '';
$this->
assertTrue($style_plugin->
buildSort(), 'If no order and no default order is specified, the normal sort should be used.'
);
$style_plugin->options
['default'
] = 'id';
$this->
assertTrue($style_plugin->
buildSort(), 'If no order but a default order is specified, the normal sort should be used.'
);
$request->attributes->
set('order',
$this->
randomMachineName());
$this->
assertTrue($style_plugin->
buildSort(), 'If no valid field is chosen for order, the normal sort should be used.'
);