You are here

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

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

Overrides ViewTestBase::dataSet

1 call to SortRandomTest::dataSet()
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 32
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 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;
}