You are here

protected function ViewsTestCase::helperCompareFunction in Views (for Drupal 7) 7.3

Same name and namespace in other branches
  1. 6.3 tests/views_query.test \ViewsTestCase::helperCompareFunction()

Helper comparison function for orderResultSet().

File

tests/views_query.test, line 109
Abstract class for views testing.

Class

ViewsTestCase

Code

protected function helperCompareFunction($a, $b) {
  $value1 = $a[$this->sort_column];
  $value2 = $b[$this->sort_column];
  if ($value1 == $value2) {
    return 0;
  }
  return $this->sort_order * ($value1 < $value2 ? -1 : 1);
}