function SelectComplexTest::testDistinct
Same name in other branches
- 9 core/tests/Drupal/KernelTests/Core/Database/SelectComplexTest.php \Drupal\KernelTests\Core\Database\SelectComplexTest::testDistinct()
- 10 core/tests/Drupal/KernelTests/Core/Database/SelectComplexTest.php \Drupal\KernelTests\Core\Database\SelectComplexTest::testDistinct()
- 11.x core/tests/Drupal/KernelTests/Core/Database/SelectComplexTest.php \Drupal\KernelTests\Core\Database\SelectComplexTest::testDistinct()
Tests distinct queries.
File
-
core/
tests/ Drupal/ KernelTests/ Core/ Database/ SelectComplexTest.php, line 176
Class
- SelectComplexTest
- Tests the Select query builder with more complex queries.
Namespace
Drupal\KernelTests\Core\DatabaseCode
public function testDistinct() {
$query = $this->connection
->select('test_task');
$query->addField('test_task', 'task');
$query->distinct();
$query_result = $query->countQuery()
->execute()
->fetchField();
$this->assertEqual($query_result, 6, 'Returned the correct number of rows.');
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.