You are here

protected function SortRandomTest::getBasicRandomView in Views (for Drupal 7) 8.3

Return a basic view with random ordering.

1 call to SortRandomTest::getBasicRandomView()
SortRandomTest::testRandomOrdering in lib/Drupal/views/Tests/Handler/SortRandomTest.php
Tests random ordering of the result set.

File

lib/Drupal/views/Tests/Handler/SortRandomTest.php, line 48
Definition of Drupal\views\Tests\Handler\SortRandomTest.

Class

SortRandomTest
Tests for core Drupal\views\Plugin\views\sort\Random handler.

Namespace

Drupal\views\Tests\Handler

Code

protected function getBasicRandomView() {
  $view = $this
    ->getView();

  // Add a random ordering.
  $view->displayHandlers['default']
    ->overrideOption('sorts', array(
    'random' => array(
      'id' => 'random',
      'field' => 'random',
      'table' => 'views',
    ),
  ));
  return $view;
}