DatabaseExceptionWrapperTest.php
Same filename in this branch
Same filename in other branches
- 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
- 11.x core/modules/sqlite/tests/src/Kernel/sqlite/DatabaseExceptionWrapperTest.php
- 11.x core/modules/mysql/tests/src/Kernel/mysql/DatabaseExceptionWrapperTest.php
- 11.x core/modules/pgsql/tests/src/Kernel/pgsql/DatabaseExceptionWrapperTest.php
- 11.x core/tests/Drupal/KernelTests/Core/Database/DatabaseExceptionWrapperTest.php
Namespace
Drupal\Tests\pgsql\Kernel\pgsqlFile
-
core/
modules/ pgsql/ tests/ src/ Kernel/ pgsql/ DatabaseExceptionWrapperTest.php
View source
<?php
namespace Drupal\Tests\pgsql\Kernel\pgsql;
use Drupal\KernelTests\Core\Database\DriverSpecificKernelTestBase;
/**
* Tests exceptions thrown by queries.
*
* @group Database
*/
class DatabaseExceptionWrapperTest extends DriverSpecificKernelTestBase {
/**
* Tests Connection::prepareStatement exception on execution.
*/
public function testPrepareStatementFailOnExecution() {
$this->expectException(\PDOException::class);
$stmt = $this->connection
->prepareStatement('bananas', []);
$stmt->execute();
}
}
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.