function ViewsHandlerSortRandomTest::getBasicRandomView

Return a basic view with random ordering.

1 call to ViewsHandlerSortRandomTest::getBasicRandomView()
ViewsHandlerSortRandomTest::testRandomOrdering in tests/handlers/views_handler_sort_random.test
Tests random ordering of the result set.

File

tests/handlers/views_handler_sort_random.test, line 43

Class

ViewsHandlerSortRandomTest
Tests for core views_handler_sort_random handler.

Code

protected function getBasicRandomView() {
    $view = $this->getBasicView();
    // Add a random ordering.
    $view->display['default']->handler
        ->override_option('sorts', array(
        'random' => array(
            'id' => 'random',
            'field' => 'random',
            'table' => 'views',
        ),
    ));
    return $view;
}