You are here

protected function ViewsHandlerSortRandomTest::dataSet in Views (for Drupal 7) 7.3

Add more items to the test set, to make the order tests more robust.

Overrides ViewsSqlTest::dataSet

1 call to ViewsHandlerSortRandomTest::dataSet()
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 27
Definition of ViewsHandlerSortRandomTest.

Class

ViewsHandlerSortRandomTest
Tests for core views_handler_sort_random handler.

Code

protected function dataSet() {
  $data = parent::dataSet();
  for ($i = 0; $i < 50; $i++) {
    $data[] = array(
      'name' => 'name_' . $i,
      'age' => $i,
      'job' => 'job_' . $i,
      'created' => rand(0, time()),
    );
  }
  return $data;
}