$this->
assertFalse($style_plugin->
buildSort(), 'If a valid order is specified and the table is configured to override, the normal sort should not be used.'
);
// Test the buildSortPost() method.
$request =
new Request();
$view->
setRequest($request);
// Setup no valid default.
$this->
prepareView($view);
$style_plugin =
$view->style_plugin;
$style_plugin->options
['default'
] = '';
$style_plugin->
buildSortPost();
$this->
assertNull($style_plugin->order, 'No sort order was set, when no order was specified and no default column was selected.'
);
$this->
assertNull($style_plugin->active, 'No sort field was set, when no order was specified and no default column was selected.'
);
$view->
destroy();
// Setup a valid default + column specific default sort order.
$this->
prepareView($view);
$style_plugin =
$view->style_plugin;
$style_plugin->options
['default'
] = 'id';
$style_plugin->options
['info'
]['id'
]['default_sort_order'
] = 'desc';
$style_plugin->
buildSortPost();
$this->
assertSame('desc',
$style_plugin->order, 'Fallback to the right default sort order.'
);