diff --git a/.appveyor.yml b/.appveyor.yml index ae7a57866d..ddc5093abc 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -122,4 +122,5 @@ test_script: after_test: - appveyor DownloadFile https://codecov.io/bash -FileName codecov.sh - - bash codecov.sh -f clover.xml + - SET upload_name=appveyor-%db%-%db_version%-%driver%-php-%php% + - bash codecov.sh -f clover.xml -n %upload_name% diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml index 5a3629db00..59cc9ebf75 100644 --- a/.github/workflows/continuous-integration.yml +++ b/.github/workflows/continuous-integration.yml @@ -654,5 +654,6 @@ jobs: with: directory: reports fail_ci_if_error: true + name: github-action env: CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} diff --git a/tests/ConnectionTest.php b/tests/ConnectionTest.php index f9702ba303..342cf07e50 100644 --- a/tests/ConnectionTest.php +++ b/tests/ConnectionTest.php @@ -160,6 +160,46 @@ public function testConnectStartsTransactionInNoAutoCommitMode(): void self::assertTrue($conn->isTransactionActive()); } + public function testTransactionIsNotActiveAfterTransactionalInAutoCommitMode(): void + { + $driverMock = self::createStub(Driver::class); + $driverMock + ->method('connect') + ->willReturn( + self::createStub(DriverConnection::class), + ); + + $conn = new Connection([], $driverMock); + + $conn->setAutoCommit(true); + + self::assertFalse($conn->isTransactionActive()); + + $conn->transactional(static function (Connection $connection): void { + }); + + self::assertFalse($conn->isTransactionActive()); + } + + public function testTransactionIsActiveAfterTransactionalInNoAutoCommitMode(): void + { + $driverMock = $this->createMock(Driver::class); + $driverMock + ->method('connect') + ->willReturn( + self::createStub(DriverConnection::class), + ); + + $conn = new Connection([], $driverMock); + + $conn->setAutoCommit(false); + + $conn->transactional(static function (Connection $connection): void { + }); + + self::assertTrue($conn->isTransactionActive()); + } + public function testCommitStartsTransactionInNoAutoCommitMode(): void { $driver = self::createStub(Driver::class);