You are here

protected function ViewTestBase::orderResultSet in Views (for Drupal 7) 8.3

Helper function: order an array of array based on a column.

2 calls to ViewTestBase::orderResultSet()
SortTest::testNumericOrdering in lib/Drupal/views/Tests/Handler/SortTest.php
Tests numeric ordering of the result set.
SortTest::testStringOrdering in lib/Drupal/views/Tests/Handler/SortTest.php
Tests string ordering of the result set.

File

lib/Drupal/views/Tests/ViewTestBase.php, line 142
Definition of Drupal\views\Tests\ViewTestBase.

Class

ViewTestBase
Abstract class for views testing.

Namespace

Drupal\views\Tests

Code

protected function orderResultSet($result_set, $column, $reverse = FALSE) {
  $this->sort_column = $column;
  $this->sort_order = $reverse ? -1 : 1;
  usort($result_set, array(
    $this,
    'helperCompareFunction',
  ));
  return $result_set;
}