$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.'
);
$request->attributes->
set('order', 'id'
);
$this->
assertTrue($style_plugin->
buildSort(), 'If a valid order is specified but the table is configured to not override, the normal sort should be used.'
);
$style_plugin->options
['override'
] = TRUE;