function TransactionManagerTest::testStartSavepointFailure
Tests failing to start a savepoint.
File
-
core/
tests/ Drupal/ Tests/ Core/ Database/ TransactionManagerTest.php, line 97
Class
- TransactionManagerTest
- Tests transactions.
Namespace
Drupal\Tests\Core\DatabaseCode
public function testStartSavepointFailure() : void {
// phpcs:ignore VariableAnalysis.CodeAnalysis.VariableAnalysis.UnusedVariable
$tx = $this->connection
->startTransaction();
$this->connection
->transactionManager()->success = FALSE;
$this->expectException(TransactionException::class);
$this->expectExceptionMessage('Failed start of savepoint foo');
// phpcs:ignore VariableAnalysis.CodeAnalysis.VariableAnalysis.UnusedVariable
$savepoint = $this->connection
->startTransaction('foo');
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.