File
- core/modules/views/tests/views_groupby.test, line 237
- Tests aggregate functionality of Views.
Class
- ViewsQueryGroupByTest
- Tests aggregate functionality of views, for example count.
Code
public function testGroupByCountOnlyFilters() {
$type1 = $this->backdropCreateContentType();
$node_1 = array(
'type' => $type1->type,
);
for ($x = 0; $x < 10; $x++) {
$this->backdropCreateNode($node_1);
}
$view = $this->viewsGroupByCountViewOnlyFilters();
$output = $view->execute_display();
$this->assertTrue(strpos($view->build_info['query'], 'GROUP BY'), t('Make sure that GROUP BY is in the query'));
$this->assertTrue(strpos($view->build_info['query'], 'HAVING'), t('Make sure that HAVING is in the query'));
}