diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index ecafed3..46ca5fd 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -102,8 +102,8 @@ jobs: - name: Run tests ${{ matrix.test-args }} continue-on-error: true - run: vendor/bin/phpunit -c core --color=always ${{ matrix.test-args }} - +# run: vendor/bin/phpunit -c core --color=always ${{ matrix.test-args }} + run: vendor/bin/phpunit -c core --color=always modules/contrib/mysqli/tests/src/Kernel/mysqli/TransactionTest.php # - uses: actions/upload-artifact@v3 # with: # name: test-results diff --git a/src/Driver/Database/mysqli/TransactionManager.php b/src/Driver/Database/mysqli/TransactionManager.php index e0f2551..859e631 100644 --- a/src/Driver/Database/mysqli/TransactionManager.php +++ b/src/Driver/Database/mysqli/TransactionManager.php @@ -47,16 +47,24 @@ protected function releaseClientSavepoint(string $name): bool { * {@inheritdoc} */ protected function rollbackClientTransaction(): bool { - return $this->connection->getClientConnection()->rollback(); + $clientRollback = $this->connection->getClientConnection()->rollBack(); + $this->setConnectionTransactionState($clientRollback ? + ClientConnectionTransactionState::RolledBack : + ClientConnectionTransactionState::RollbackFailed + ); + return $clientRollback; } /** * {@inheritdoc} */ protected function commitClientTransaction(): bool { - $success = $this->connection->getClientConnection()->commit(); -dump([__METHOD__, $success]); - return $success; + $clientCommit = $this->connection->getClientConnection()->commit(); + $this->setConnectionTransactionState($clientCommit ? + ClientConnectionTransactionState::Committed : + ClientConnectionTransactionState::CommitFailed + ); + return $clientCommit; } }