Skip to content
This repository has been archived by the owner on Oct 8, 2023. It is now read-only.

Commit

Permalink
I
Browse files Browse the repository at this point in the history
  • Loading branch information
mondrake committed Aug 30, 2023
1 parent fd902b9 commit 1d6db81
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 8 deletions.
7 changes: 0 additions & 7 deletions src/Driver/Database/mysqli/Connection.php
Original file line number Diff line number Diff line change
Expand Up @@ -220,11 +220,4 @@ protected function driverTransactionManager(): TransactionManagerInterface {
return new TransactionManager($this);
}

/**
* {@inheritdoc}
*/
public function startTransaction($name = '') {
return $this->transactionManager()->push($name);
}

}
4 changes: 3 additions & 1 deletion src/Driver/Database/mysqli/TransactionManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,9 @@ protected function rollbackClientTransaction(): bool {
* {@inheritdoc}
*/
protected function commitClientTransaction(): bool {
return $this->connection->getClientConnection()->commit();
$success = $this->connection->getClientConnection()->commit();
dump([__METHOD__, $success]);
return $success;
}

}
11 changes: 11 additions & 0 deletions tests/src/Kernel/mysqli/TransactionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -113,4 +113,15 @@ public function testConnectionDeprecations(): void {
$this->markTestSkipped('Skipping this for mysqli');
}


/**
* A post-transaction callback for testing purposes.
*/
public function rootTransactionCallback(bool $success): void {
dump([__METHOD__, $success]);
$this->postTransactionCallbackAction = $success ? 'rtcCommit' : 'rtcRollback';
$this->insertRow($this->postTransactionCallbackAction);
}


}

0 comments on commit 1d6db81

Please sign in to comment.