public function SelectTest::testInvalidSelectCount in Drupal 10
Same name and namespace in other branches
- 8 core/tests/Drupal/KernelTests/Core/Database/SelectTest.php \Drupal\KernelTests\Core\Database\SelectTest::testInvalidSelectCount()
- 9 core/tests/Drupal/KernelTests/Core/Database/SelectTest.php \Drupal\KernelTests\Core\Database\SelectTest::testInvalidSelectCount()
Tests that an invalid count query throws an exception.
File
- core/
tests/ Drupal/ KernelTests/ Core/ Database/ SelectTest.php, line 556
Class
- SelectTest
- Tests the Select query builder.
Namespace
Drupal\KernelTests\Core\DatabaseCode
public function testInvalidSelectCount() {
$this
->expectException(DatabaseExceptionWrapper::class);
// This query will fail because the table does not exist.
$this->connection
->select('some_table_that_does_not_exist', 't')
->fields('t')
->countQuery()
->execute();
}