DatabaseExceptionWrapperTest.php
Same filename in this branch
Same filename in other branches
- 9 core/modules/sqlite/tests/src/Kernel/sqlite/DatabaseExceptionWrapperTest.php
- 9 core/modules/mysql/tests/src/Kernel/mysql/DatabaseExceptionWrapperTest.php
- 9 core/modules/pgsql/tests/src/Kernel/pgsql/DatabaseExceptionWrapperTest.php
- 9 core/tests/Drupal/KernelTests/Core/Database/DatabaseExceptionWrapperTest.php
- 8.9.x core/tests/Drupal/KernelTests/Core/Database/DatabaseExceptionWrapperTest.php
- 10 core/modules/sqlite/tests/src/Kernel/sqlite/DatabaseExceptionWrapperTest.php
- 10 core/modules/mysql/tests/src/Kernel/mysql/DatabaseExceptionWrapperTest.php
- 10 core/modules/pgsql/tests/src/Kernel/pgsql/DatabaseExceptionWrapperTest.php
- 10 core/tests/Drupal/KernelTests/Core/Database/DatabaseExceptionWrapperTest.php
Namespace
Drupal\KernelTests\Core\DatabaseFile
-
core/
tests/ Drupal/ KernelTests/ Core/ Database/ DatabaseExceptionWrapperTest.php
View source
<?php
declare (strict_types=1);
namespace Drupal\KernelTests\Core\Database;
use Drupal\Core\Database\DatabaseExceptionWrapper;
use Drupal\Core\Database\Database;
use Drupal\KernelTests\KernelTestBase;
/**
* Tests exceptions thrown by queries.
*
* @group Database
*/
class DatabaseExceptionWrapperTest extends KernelTestBase {
/**
* Tests the expected database exception thrown for inexistent tables.
*/
public function testQueryThrowsDatabaseExceptionWrapperException() : void {
$this->expectException(DatabaseExceptionWrapper::class);
Database::getConnection()->query('SELECT * FROM {does_not_exist}');
}
}
Classes
Title | Deprecated | Summary |
---|---|---|
DatabaseExceptionWrapperTest | Tests exceptions thrown by queries. |
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.