function DatabaseExceptionWrapperTest::testPrepareStatementFailOnExecution
Tests Connection::prepareStatement exception on execution.
Overrides DatabaseExceptionWrapperTest::testPrepareStatementFailOnExecution
File
-
core/
modules/ mysqli/ tests/ src/ Kernel/ mysqli/ DatabaseExceptionWrapperTest.php, line 34
Class
- DatabaseExceptionWrapperTest
- Tests exceptions thrown by queries.
Namespace
Drupal\Tests\mysqli\Kernel\mysqliCode
public function testPrepareStatementFailOnExecution() : void {
$this->expectException(\mysqli_sql_exception::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.