function TransactionTest::testCommitTransactionWhenInactive
Tests committing a transaction when there's none active on the client.
MySQLi does not fail if multiple commits are made on the client, so this test is failing. Let's change this if/when MySQLi will provide a way to check if a client transaction is active.
This is mitigated by the fact that transaction should not be initiated from code outside the TransactionManager, that keeps track of the stack of transaction-related operations in its stack.
File
-
core/
modules/ mysqli/ tests/ src/ Kernel/ mysqli/ TransactionTest.php, line 45
Class
- TransactionTest
- Tests transaction for the MySQLi driver.
Namespace
Drupal\Tests\mysqli\Kernel\mysqliCode
public function testCommitTransactionWhenInactive() : void {
$this->markTestSkipped('Skipping this while MySQLi cannot detect if a client transaction is active.');
$transaction = $this->connection
->startTransaction();
$this->assertTrue($this->connection
->inTransaction());
$this->connection
->getClientConnection()
->commit();
$this->assertFalse($this->connection
->inTransaction());
unset($transaction);
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.