@@ -27,7 +27,7 @@ final class PostgresAdvisoryLockerTest extends AbstractIntegrationTestCase
27
27
28
28
#[DataProvider('provideItCanTryAcquireLockWithinSessionData ' )]
29
29
public function testItCanTryAcquireLockWithinSession (
30
- PostgresLockAccessModeEnum $ mode ,
30
+ PostgresLockAccessModeEnum $ accessMode ,
31
31
): void {
32
32
$ locker = $ this ->initLocker ();
33
33
$ dbConnection = $ this ->initPostgresPdoConnection ();
@@ -36,12 +36,12 @@ public function testItCanTryAcquireLockWithinSession(
36
36
$ isLockAcquired = $ locker ->acquireSessionLevelLock (
37
37
$ dbConnection ,
38
38
$ postgresLockId ,
39
- accessMode: $ mode ,
39
+ accessMode: $ accessMode ,
40
40
);
41
41
42
42
$ this ->assertTrue ($ isLockAcquired );
43
43
$ this ->assertPgAdvisoryLocksCount (1 );
44
- $ this ->assertPgAdvisoryLockExistsInConnection ($ dbConnection , $ postgresLockId , $ mode );
44
+ $ this ->assertPgAdvisoryLockExistsInConnection ($ dbConnection , $ postgresLockId , $ accessMode );
45
45
}
46
46
47
47
public static function provideItCanTryAcquireLockWithinSessionData (): array
@@ -58,7 +58,7 @@ public static function provideItCanTryAcquireLockWithinSessionData(): array
58
58
59
59
#[DataProvider('provideItCanTryAcquireLockWithinTransactionData ' )]
60
60
public function testItCanTryAcquireLockWithinTransaction (
61
- PostgresLockAccessModeEnum $ mode ,
61
+ PostgresLockAccessModeEnum $ accessMode ,
62
62
): void {
63
63
$ locker = $ this ->initLocker ();
64
64
$ dbConnection = $ this ->initPostgresPdoConnection ();
@@ -68,12 +68,12 @@ public function testItCanTryAcquireLockWithinTransaction(
68
68
$ isLockAcquired = $ locker ->acquireTransactionLevelLock (
69
69
$ dbConnection ,
70
70
$ postgresLockId ,
71
- accessMode: $ mode ,
71
+ accessMode: $ accessMode ,
72
72
);
73
73
74
74
$ this ->assertTrue ($ isLockAcquired );
75
75
$ this ->assertPgAdvisoryLocksCount (1 );
76
- $ this ->assertPgAdvisoryLockExistsInConnection ($ dbConnection , $ postgresLockId , $ mode );
76
+ $ this ->assertPgAdvisoryLockExistsInConnection ($ dbConnection , $ postgresLockId , $ accessMode );
77
77
}
78
78
79
79
public static function provideItCanTryAcquireLockWithinTransactionData (): array
@@ -194,21 +194,21 @@ public function testItCannotAcquireSameLockInTwoConnections(): void
194
194
195
195
#[DataProvider('provideItCanReleaseLockData ' )]
196
196
public function testItCanReleaseLock (
197
- PostgresLockAccessModeEnum $ mode ,
197
+ PostgresLockAccessModeEnum $ accessMode ,
198
198
): void {
199
199
$ locker = $ this ->initLocker ();
200
200
$ dbConnection = $ this ->initPostgresPdoConnection ();
201
201
$ postgresLockId = PostgresLockId::fromKeyValue ('test ' );
202
202
$ locker ->acquireSessionLevelLock (
203
203
$ dbConnection ,
204
204
$ postgresLockId ,
205
- accessMode: $ mode ,
205
+ accessMode: $ accessMode ,
206
206
);
207
207
208
208
$ isLockReleased = $ locker ->releaseSessionLevelLock (
209
209
$ dbConnection ,
210
210
$ postgresLockId ,
211
- accessMode: $ mode ,
211
+ accessMode: $ accessMode ,
212
212
);
213
213
214
214
$ this ->assertTrue ($ isLockReleased );
@@ -256,12 +256,12 @@ public static function provideItCanNotReleaseLockOfDifferentModesData(): array
256
256
{
257
257
return [
258
258
'release exclusive lock as share ' => [
259
- 'acquireMode ' => PostgresLockAccessModeEnum::Exclusive,
260
- 'releaseMode ' => PostgresLockAccessModeEnum::Share,
259
+ 'acquireAccessMode ' => PostgresLockAccessModeEnum::Exclusive,
260
+ 'releaseAccessMode ' => PostgresLockAccessModeEnum::Share,
261
261
],
262
262
'release share lock as exclusive ' => [
263
- 'acquireMode ' => PostgresLockAccessModeEnum::Share,
264
- 'releaseMode ' => PostgresLockAccessModeEnum::Exclusive,
263
+ 'acquireAccessMode ' => PostgresLockAccessModeEnum::Share,
264
+ 'releaseAccessMode ' => PostgresLockAccessModeEnum::Exclusive,
265
265
],
266
266
];
267
267
}
0 commit comments