Return a basic view with random ordering.
protected function getBasicRandomView() {
$view = views_get_view('test_view');
$view
->setDisplay();
// Add a random ordering.
$view->displayHandlers
->get('default')
->overrideOption('sorts', array(
'random' => array(
'id' => 'random',
'field' => 'random',
'table' => 'views',
),
));
return $view;
}