public function SelectComplexTest::testSelectWithRowCount in Drupal 9
Same name and namespace in other branches
- 8 core/tests/Drupal/KernelTests/Core/Database/SelectComplexTest.php \Drupal\KernelTests\Core\Database\SelectComplexTest::testSelectWithRowCount()
Tests that rowCount() throws exception on SELECT query.
File
- core/
tests/ Drupal/ KernelTests/ Core/ Database/ SelectComplexTest.php, line 383
Class
- SelectComplexTest
- Tests the Select query builder with more complex queries.
Namespace
Drupal\KernelTests\Core\DatabaseCode
public function testSelectWithRowCount() {
$query = $this->connection
->select('test');
$query
->addField('test', 'name');
$result = $query
->execute();
try {
$result
->rowCount();
$exception = FALSE;
} catch (RowCountException $e) {
$exception = TRUE;
}
$this
->assertTrue($exception, 'Exception was thrown');
}