public function DatabaseExceptionWrapperTest::testQueryThrowsDatabaseExceptionWrapperException in Drupal 10
Same name and namespace in other branches
- 8 core/tests/Drupal/KernelTests/Core/Database/DatabaseExceptionWrapperTest.php \Drupal\KernelTests\Core\Database\DatabaseExceptionWrapperTest::testQueryThrowsDatabaseExceptionWrapperException()
- 9 core/tests/Drupal/KernelTests/Core/Database/DatabaseExceptionWrapperTest.php \Drupal\KernelTests\Core\Database\DatabaseExceptionWrapperTest::testQueryThrowsDatabaseExceptionWrapperException()
Tests the expected database exception thrown for inexistent tables.
File
- core/
tests/ Drupal/ KernelTests/ Core/ Database/ DatabaseExceptionWrapperTest.php, line 61
Class
- DatabaseExceptionWrapperTest
- Tests exceptions thrown by queries.
Namespace
Drupal\KernelTests\Core\DatabaseCode
public function testQueryThrowsDatabaseExceptionWrapperException() {
$this
->expectException(DatabaseExceptionWrapper::class);
Database::getConnection()
->query('SELECT * FROM {does_not_exist}');
}