function DatabaseExceptionWrapperTest::testPrepareStatementFailOnExecution
Same name in this branch
- 10 core/modules/sqlite/tests/src/Kernel/sqlite/DatabaseExceptionWrapperTest.php \Drupal\Tests\sqlite\Kernel\sqlite\DatabaseExceptionWrapperTest::testPrepareStatementFailOnExecution()
- 10 core/modules/pgsql/tests/src/Kernel/pgsql/DatabaseExceptionWrapperTest.php \Drupal\Tests\pgsql\Kernel\pgsql\DatabaseExceptionWrapperTest::testPrepareStatementFailOnExecution()
Same name in other branches
- 9 core/modules/sqlite/tests/src/Kernel/sqlite/DatabaseExceptionWrapperTest.php \Drupal\Tests\sqlite\Kernel\sqlite\DatabaseExceptionWrapperTest::testPrepareStatementFailOnExecution()
- 9 core/modules/mysql/tests/src/Kernel/mysql/DatabaseExceptionWrapperTest.php \Drupal\Tests\mysql\Kernel\mysql\DatabaseExceptionWrapperTest::testPrepareStatementFailOnExecution()
- 9 core/modules/pgsql/tests/src/Kernel/pgsql/DatabaseExceptionWrapperTest.php \Drupal\Tests\pgsql\Kernel\pgsql\DatabaseExceptionWrapperTest::testPrepareStatementFailOnExecution()
- 11.x core/modules/sqlite/tests/src/Kernel/sqlite/DatabaseExceptionWrapperTest.php \Drupal\Tests\sqlite\Kernel\sqlite\DatabaseExceptionWrapperTest::testPrepareStatementFailOnExecution()
- 11.x core/modules/mysql/tests/src/Kernel/mysql/DatabaseExceptionWrapperTest.php \Drupal\Tests\mysql\Kernel\mysql\DatabaseExceptionWrapperTest::testPrepareStatementFailOnExecution()
- 11.x core/modules/pgsql/tests/src/Kernel/pgsql/DatabaseExceptionWrapperTest.php \Drupal\Tests\pgsql\Kernel\pgsql\DatabaseExceptionWrapperTest::testPrepareStatementFailOnExecution()
Tests Connection::prepareStatement exception on execution.
File
-
core/
modules/ mysql/ tests/ src/ Kernel/ mysql/ DatabaseExceptionWrapperTest.php, line 39
Class
- DatabaseExceptionWrapperTest
- Tests exceptions thrown by queries.
Namespace
Drupal\Tests\mysql\Kernel\mysqlCode
public function testPrepareStatementFailOnExecution() : void {
$this->expectException(\PDOException::class);
$stmt = $this->connection
->prepareStatement('bananas', []);
$stmt->execute();
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.