function TransactionTest::testRootTransactionEndCallbackAddedWithoutTransaction
Same name and namespace in other branches
- 11.x core/tests/Drupal/KernelTests/Core/Database/TransactionTest.php \Drupal\KernelTests\Core\Database\TransactionTest::testRootTransactionEndCallbackAddedWithoutTransaction()
Tests that adding a post-transaction callback fails with no transaction.
File
-
core/
tests/ Drupal/ KernelTests/ Core/ Database/ TransactionTest.php, line 1043
Class
- TransactionTest
- Tests the transactions, using the explicit ::commitOrRelease method.
Namespace
Drupal\KernelTests\Core\DatabaseCode
public function testRootTransactionEndCallbackAddedWithoutTransaction() : void {
$this->expectException(\LogicException::class);
$this->connection
->transactionManager()
->addPostTransactionCallback([
$this,
'rootTransactionCallback',
]);
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.