|
14 | 14 | namespace Cog\Test\DbLocker\Integration\Locker;
|
15 | 15 |
|
16 | 16 | use Cog\DbLocker\Locker\PostgresAdvisoryLocker;
|
17 |
| -use Cog\DbLocker\Locker\PostgresAdvisoryLockLevelEnum; |
18 | 17 | use Cog\DbLocker\Locker\PostgresLockAccessModeEnum;
|
19 | 18 | use Cog\DbLocker\LockId\PostgresLockId;
|
20 | 19 | use Cog\Test\DbLocker\Integration\AbstractIntegrationTestCase;
|
@@ -567,36 +566,6 @@ public function testItCannotReleaseAllLocksAcquiredWithinTransaction(): void
|
567 | 566 | $this->assertPgAdvisoryLockExistsInConnection($dbConnection, $postgresLockId2);
|
568 | 567 | }
|
569 | 568 |
|
570 |
| - public function testItCannotReleaseLockWithTransactionScope(): void |
571 |
| - { |
572 |
| - $locker = $this->initLocker(); |
573 |
| - $dbConnection = $this->initPostgresPdoConnection(); |
574 |
| - $postgresLockId1 = PostgresLockId::fromKeyValue('test'); |
575 |
| - $postgresLockId2 = PostgresLockId::fromKeyValue('test2'); |
576 |
| - $locker->acquireSessionLevelLock( |
577 |
| - $dbConnection, |
578 |
| - $postgresLockId1, |
579 |
| - ); |
580 |
| - $dbConnection->beginTransaction(); |
581 |
| - $locker->acquireTransactionLevelLock( |
582 |
| - $dbConnection, |
583 |
| - $postgresLockId2, |
584 |
| - ); |
585 |
| - |
586 |
| - try { |
587 |
| - $locker->releaseSessionLevelLock( |
588 |
| - $dbConnection, |
589 |
| - $postgresLockId2, |
590 |
| - PostgresAdvisoryLockLevelEnum::Transaction, |
591 |
| - ); |
592 |
| - } catch (\InvalidArgumentException $exception) { |
593 |
| - $this->assertSame( |
594 |
| - 'Transaction-level advisory lock cannot be released', |
595 |
| - $exception->getMessage(), |
596 |
| - ); |
597 |
| - } |
598 |
| - } |
599 |
| - |
600 | 569 | private function initLocker(): PostgresAdvisoryLocker
|
601 | 570 | {
|
602 | 571 | return new PostgresAdvisoryLocker();
|
|
0 commit comments