1 views_query.test protected ViewsTestCase::helperCompareFunction($a, $b)

Helper comparison function for orderResultSet().

File

core/modules/views/tests/views_query.test, line 95
Tests for Views query features.

Class

ViewsTestCase
Abstract class for views testing.

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);
}