function SelectPagerDefaultTest::testHavingPagerQuery
Same name in other branches
- 9 core/modules/system/tests/src/Functional/Database/SelectPagerDefaultTest.php \Drupal\Tests\system\Functional\Database\SelectPagerDefaultTest::testHavingPagerQuery()
- 8.9.x core/modules/system/tests/src/Functional/Database/SelectPagerDefaultTest.php \Drupal\Tests\system\Functional\Database\SelectPagerDefaultTest::testHavingPagerQuery()
- 10 core/modules/system/tests/src/Functional/Database/SelectPagerDefaultTest.php \Drupal\Tests\system\Functional\Database\SelectPagerDefaultTest::testHavingPagerQuery()
Confirms that a paging query results with a having expression are valid.
This is a regression test for #467984.
File
-
core/
modules/ system/ tests/ src/ Functional/ Database/ SelectPagerDefaultTest.php, line 122
Class
- SelectPagerDefaultTest
- Tests the pager query select extender.
Namespace
Drupal\Tests\system\Functional\DatabaseCode
public function testHavingPagerQuery() : void {
$query = Database::getConnection()->select('test', 't')
->extend(PagerSelectExtender::class);
$query->fields('t', [
'name',
])
->orderBy('name')
->groupBy('name')
->having('MAX([age]) > :count', [
':count' => 26,
])
->limit(5);
$ages = $query->execute()
->fetchCol();
$this->assertEquals([
'George',
'Ringo',
], $ages, 'Pager query with having expression returned the correct ages.');
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.