function DatabaseExceptionWrapperTest::testPrepareStatementFailOnExecution

Same name in this branch
  1. 11.x core/modules/sqlite/tests/src/Kernel/sqlite/DatabaseExceptionWrapperTest.php \Drupal\Tests\sqlite\Kernel\sqlite\DatabaseExceptionWrapperTest::testPrepareStatementFailOnExecution()
  2. 11.x core/modules/mysql/tests/src/Kernel/mysql/DatabaseExceptionWrapperTest.php \Drupal\Tests\mysql\Kernel\mysql\DatabaseExceptionWrapperTest::testPrepareStatementFailOnExecution()
  3. 11.x core/modules/pgsql/tests/src/Kernel/pgsql/DatabaseExceptionWrapperTest.php \Drupal\Tests\pgsql\Kernel\pgsql\DatabaseExceptionWrapperTest::testPrepareStatementFailOnExecution()
Same name and namespace in other branches
  1. 9 core/modules/sqlite/tests/src/Kernel/sqlite/DatabaseExceptionWrapperTest.php \Drupal\Tests\sqlite\Kernel\sqlite\DatabaseExceptionWrapperTest::testPrepareStatementFailOnExecution()
  2. 9 core/modules/mysql/tests/src/Kernel/mysql/DatabaseExceptionWrapperTest.php \Drupal\Tests\mysql\Kernel\mysql\DatabaseExceptionWrapperTest::testPrepareStatementFailOnExecution()
  3. 9 core/modules/pgsql/tests/src/Kernel/pgsql/DatabaseExceptionWrapperTest.php \Drupal\Tests\pgsql\Kernel\pgsql\DatabaseExceptionWrapperTest::testPrepareStatementFailOnExecution()
  4. 10 core/modules/sqlite/tests/src/Kernel/sqlite/DatabaseExceptionWrapperTest.php \Drupal\Tests\sqlite\Kernel\sqlite\DatabaseExceptionWrapperTest::testPrepareStatementFailOnExecution()
  5. 10 core/modules/mysql/tests/src/Kernel/mysql/DatabaseExceptionWrapperTest.php \Drupal\Tests\mysql\Kernel\mysql\DatabaseExceptionWrapperTest::testPrepareStatementFailOnExecution()
  6. 10 core/modules/pgsql/tests/src/Kernel/pgsql/DatabaseExceptionWrapperTest.php \Drupal\Tests\pgsql\Kernel\pgsql\DatabaseExceptionWrapperTest::testPrepareStatementFailOnExecution()

Tests Connection::prepareStatement exception on execution.

Overrides DatabaseExceptionWrapperTest::testPrepareStatementFailOnExecution

File

core/modules/mysqli/tests/src/Kernel/mysqli/DatabaseExceptionWrapperTest.php, line 32

Class

DatabaseExceptionWrapperTest
Tests exceptions thrown by queries.

Namespace

Drupal\Tests\mysqli\Kernel\mysqli

Code

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.