function TransactionManagerTest::testTransactionRollbackFailure
Tests a transaction rollback failure.
File
-
core/
tests/ Drupal/ Tests/ Core/ Database/ TransactionManagerTest.php, line 227
Class
- TransactionManagerTest
- Tests transactions.
Namespace
Drupal\Tests\Core\DatabaseCode
public function testTransactionRollbackFailure() : void {
$tx = $this->connection
->startTransaction();
$this->connection
->transactionManager()->success = FALSE;
$this->expectException(TransactionException::class);
$this->expectExceptionMessage('Failed rollback of transaction');
$tx->rollback();
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.