function DatabaseExceptionWrapperTest::testQueryThrowsDatabaseExceptionWrapperException
Same name in other branches
- 9 core/tests/Drupal/KernelTests/Core/Database/DatabaseExceptionWrapperTest.php \Drupal\KernelTests\Core\Database\DatabaseExceptionWrapperTest::testQueryThrowsDatabaseExceptionWrapperException()
- 8.9.x core/tests/Drupal/KernelTests/Core/Database/DatabaseExceptionWrapperTest.php \Drupal\KernelTests\Core\Database\DatabaseExceptionWrapperTest::testQueryThrowsDatabaseExceptionWrapperException()
- 10 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 21
Class
- DatabaseExceptionWrapperTest
- Tests exceptions thrown by queries.
Namespace
Drupal\KernelTests\Core\DatabaseCode
public function testQueryThrowsDatabaseExceptionWrapperException() : void {
$this->expectException(DatabaseExceptionWrapper::class);
Database::getConnection()->query('SELECT * FROM {does_not_exist}');
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.