function QueryGroupByTest::testAggregateCountFunction
Same name in other branches
- 9 core/modules/views/tests/src/Kernel/QueryGroupByTest.php \Drupal\Tests\views\Kernel\QueryGroupByTest::testAggregateCountFunction()
- 10 core/modules/views/tests/src/Kernel/QueryGroupByTest.php \Drupal\Tests\views\Kernel\QueryGroupByTest::testAggregateCountFunction()
Tests aggregate count feature with no group by.
File
-
core/
modules/ views/ tests/ src/ Kernel/ QueryGroupByTest.php, line 91
Class
- QueryGroupByTest
- Tests aggregate functionality of views, for example count.
Namespace
Drupal\Tests\views\KernelCode
public function testAggregateCountFunction() : void {
$this->setupTestEntities();
$view = Views::getView('test_aggregate_count_function');
$this->executeView($view);
$this->assertEquals(7, $view->result[0]->id);
$this->assertCount(1, $view->result, 'Make sure the count of rows is one.');
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.