1 database_test.test DatabaseSelectPagerDefaultTestCase::testHavingPagerQuery()

Confirm that a paging query with a having expression returns valid results.

This is a regression test for #467984.

File

core/modules/simpletest/tests/database_test.test, line 2395
Database tests.

Class

DatabaseSelectPagerDefaultTestCase

Code

function testHavingPagerQuery() {
  $query = db_select('test', 't')->extend('PagerDefault');
  $query
  ->fields('t', array('name'))
    ->orderBy('name')
    ->groupBy('name')
    ->having('MAX(age) > :count', array(':count' => 26))
    ->limit(5);

  $ages = $query
  ->execute()
    ->fetchCol();
  $this->assertEqual($ages, array('George', 'Ringo'), 'Pager query with having expression returned the correct ages.');
}