@@ -32,7 +32,7 @@ class LockTest extends TestCase
32
32
{
33
33
public function testAcquireNoBlocking ()
34
34
{
35
- $ key = new Key (uniqid ( __METHOD__ , true ) );
35
+ $ key = new Key (__METHOD__ );
36
36
$ store = $ this ->createMock (PersistingStoreInterface::class);
37
37
$ lock = new Lock ($ key , $ store );
38
38
@@ -48,7 +48,7 @@ public function testAcquireNoBlocking()
48
48
49
49
public function testAcquireNoBlockingWithPersistingStoreInterface ()
50
50
{
51
- $ key = new Key (uniqid ( __METHOD__ , true ) );
51
+ $ key = new Key (__METHOD__ );
52
52
$ store = $ this ->createMock (PersistingStoreInterface::class);
53
53
$ lock = new Lock ($ key , $ store );
54
54
@@ -64,7 +64,7 @@ public function testAcquireNoBlockingWithPersistingStoreInterface()
64
64
65
65
public function testAcquireBlockingWithPersistingStoreInterface ()
66
66
{
67
- $ key = new Key (uniqid ( __METHOD__ , true ) );
67
+ $ key = new Key (__METHOD__ );
68
68
$ store = $ this ->createMock (PersistingStoreInterface::class);
69
69
$ lock = new Lock ($ key , $ store );
70
70
@@ -80,7 +80,7 @@ public function testAcquireBlockingWithPersistingStoreInterface()
80
80
81
81
public function testAcquireBlockingRetryWithPersistingStoreInterface ()
82
82
{
83
- $ key = new Key (uniqid ( __METHOD__ , true ) );
83
+ $ key = new Key (__METHOD__ );
84
84
$ store = $ this ->createMock (PersistingStoreInterface::class);
85
85
$ lock = new Lock ($ key , $ store );
86
86
@@ -102,7 +102,7 @@ public function testAcquireBlockingRetryWithPersistingStoreInterface()
102
102
103
103
public function testAcquireReturnsFalse ()
104
104
{
105
- $ key = new Key (uniqid ( __METHOD__ , true ) );
105
+ $ key = new Key (__METHOD__ );
106
106
$ store = $ this ->createMock (PersistingStoreInterface::class);
107
107
$ lock = new Lock ($ key , $ store );
108
108
@@ -119,7 +119,7 @@ public function testAcquireReturnsFalse()
119
119
120
120
public function testAcquireReturnsFalseStoreInterface ()
121
121
{
122
- $ key = new Key (uniqid ( __METHOD__ , true ) );
122
+ $ key = new Key (__METHOD__ );
123
123
$ store = $ this ->createMock (PersistingStoreInterface::class);
124
124
$ lock = new Lock ($ key , $ store );
125
125
@@ -136,7 +136,7 @@ public function testAcquireReturnsFalseStoreInterface()
136
136
137
137
public function testAcquireBlockingWithBlockingStoreInterface ()
138
138
{
139
- $ key = new Key (uniqid ( __METHOD__ , true ) );
139
+ $ key = new Key (__METHOD__ );
140
140
$ store = $ this ->createMock (BlockingStoreInterface::class);
141
141
$ lock = new Lock ($ key , $ store );
142
142
@@ -155,7 +155,7 @@ public function testAcquireBlockingWithBlockingStoreInterface()
155
155
156
156
public function testAcquireSetsTtl ()
157
157
{
158
- $ key = new Key (uniqid ( __METHOD__ , true ) );
158
+ $ key = new Key (__METHOD__ );
159
159
$ store = $ this ->createMock (PersistingStoreInterface::class);
160
160
$ lock = new Lock ($ key , $ store , 10 );
161
161
@@ -175,7 +175,7 @@ public function testAcquireSetsTtl()
175
175
176
176
public function testRefresh ()
177
177
{
178
- $ key = new Key (uniqid ( __METHOD__ , true ) );
178
+ $ key = new Key (__METHOD__ );
179
179
$ store = $ this ->createMock (PersistingStoreInterface::class);
180
180
$ lock = new Lock ($ key , $ store , 10 );
181
181
@@ -192,7 +192,7 @@ public function testRefresh()
192
192
193
193
public function testRefreshCustom ()
194
194
{
195
- $ key = new Key (uniqid ( __METHOD__ , true ) );
195
+ $ key = new Key (__METHOD__ );
196
196
$ store = $ this ->createMock (PersistingStoreInterface::class);
197
197
$ lock = new Lock ($ key , $ store , 10 );
198
198
@@ -209,7 +209,7 @@ public function testRefreshCustom()
209
209
210
210
public function testIsAquired ()
211
211
{
212
- $ key = new Key (uniqid ( __METHOD__ , true ) );
212
+ $ key = new Key (__METHOD__ );
213
213
$ store = $ this ->createMock (PersistingStoreInterface::class);
214
214
$ lock = new Lock ($ key , $ store , 10 );
215
215
@@ -223,7 +223,7 @@ public function testIsAquired()
223
223
224
224
public function testRelease ()
225
225
{
226
- $ key = new Key (uniqid ( __METHOD__ , true ) );
226
+ $ key = new Key (__METHOD__ );
227
227
$ store = $ this ->createMock (PersistingStoreInterface::class);
228
228
$ lock = new Lock ($ key , $ store , 10 );
229
229
@@ -243,7 +243,7 @@ public function testRelease()
243
243
244
244
public function testReleaseStoreInterface ()
245
245
{
246
- $ key = new Key (uniqid ( __METHOD__ , true ) );
246
+ $ key = new Key (__METHOD__ );
247
247
$ store = $ this ->createMock (PersistingStoreInterface::class);
248
248
$ lock = new Lock ($ key , $ store , 10 );
249
249
@@ -263,7 +263,7 @@ public function testReleaseStoreInterface()
263
263
264
264
public function testReleaseOnDestruction ()
265
265
{
266
- $ key = new Key (uniqid ( __METHOD__ , true ) );
266
+ $ key = new Key (__METHOD__ );
267
267
$ store = $ this ->createMock (BlockingStoreInterface::class);
268
268
$ lock = new Lock ($ key , $ store , 10 );
269
269
@@ -282,7 +282,7 @@ public function testReleaseOnDestruction()
282
282
283
283
public function testNoAutoReleaseWhenNotConfigured ()
284
284
{
285
- $ key = new Key (uniqid ( __METHOD__ , true ) );
285
+ $ key = new Key (__METHOD__ );
286
286
$ store = $ this ->createMock (BlockingStoreInterface::class);
287
287
$ lock = new Lock ($ key , $ store , 10 , false );
288
288
@@ -302,7 +302,7 @@ public function testNoAutoReleaseWhenNotConfigured()
302
302
public function testReleaseThrowsExceptionWhenDeletionFail ()
303
303
{
304
304
$ this ->expectException (LockReleasingException::class);
305
- $ key = new Key (uniqid ( __METHOD__ , true ) );
305
+ $ key = new Key (__METHOD__ );
306
306
$ store = $ this ->createMock (PersistingStoreInterface::class);
307
307
$ lock = new Lock ($ key , $ store , 10 );
308
308
@@ -324,7 +324,7 @@ public function testReleaseThrowsExceptionWhenDeletionFail()
324
324
public function testReleaseThrowsExceptionIfNotWellDeleted ()
325
325
{
326
326
$ this ->expectException (LockReleasingException::class);
327
- $ key = new Key (uniqid ( __METHOD__ , true ) );
327
+ $ key = new Key (__METHOD__ );
328
328
$ store = $ this ->createMock (PersistingStoreInterface::class);
329
329
$ lock = new Lock ($ key , $ store , 10 );
330
330
@@ -345,7 +345,7 @@ public function testReleaseThrowsExceptionIfNotWellDeleted()
345
345
public function testReleaseThrowsAndLog ()
346
346
{
347
347
$ this ->expectException (LockReleasingException::class);
348
- $ key = new Key (uniqid ( __METHOD__ , true ) );
348
+ $ key = new Key (__METHOD__ );
349
349
$ store = $ this ->createMock (PersistingStoreInterface::class);
350
350
$ logger = $ this ->createMock (LoggerInterface::class);
351
351
$ lock = new Lock ($ key , $ store , 10 , true );
@@ -402,7 +402,7 @@ public function logs(): array
402
402
*/
403
403
public function testExpiration ($ ttls , $ expected )
404
404
{
405
- $ key = new Key (uniqid ( __METHOD__ , true ) );
405
+ $ key = new Key (__METHOD__ );
406
406
$ store = $ this ->createMock (PersistingStoreInterface::class);
407
407
$ lock = new Lock ($ key , $ store , 10 );
408
408
@@ -421,7 +421,7 @@ public function testExpiration($ttls, $expected)
421
421
*/
422
422
public function testExpirationStoreInterface ($ ttls , $ expected )
423
423
{
424
- $ key = new Key (uniqid ( __METHOD__ , true ) );
424
+ $ key = new Key (__METHOD__ );
425
425
$ store = $ this ->createMock (PersistingStoreInterface::class);
426
426
$ lock = new Lock ($ key , $ store , 10 );
427
427
@@ -448,7 +448,7 @@ public static function provideExpiredDates()
448
448
449
449
public function testAcquireReadNoBlockingWithSharedLockStoreInterface ()
450
450
{
451
- $ key = new Key (uniqid ( __METHOD__ , true ) );
451
+ $ key = new Key (__METHOD__ );
452
452
$ store = $ this ->createMock (SharedLockStoreInterface::class);
453
453
$ lock = new Lock ($ key , $ store );
454
454
@@ -467,7 +467,7 @@ public function testAcquireReadNoBlockingWithSharedLockStoreInterface()
467
467
*/
468
468
public function testAcquireReadTwiceWithExpiration ()
469
469
{
470
- $ key = new Key (uniqid ( __METHOD__ , true ) );
470
+ $ key = new Key (__METHOD__ );
471
471
$ store = new class () implements PersistingStoreInterface {
472
472
use ExpiringStoreTrait;
473
473
private array $ keys = [];
@@ -511,7 +511,7 @@ public function putOffExpiration(Key $key, $ttl): void
511
511
*/
512
512
public function testAcquireTwiceWithExpiration ()
513
513
{
514
- $ key = new Key (uniqid ( __METHOD__ , true ) );
514
+ $ key = new Key (__METHOD__ );
515
515
$ store = new class () implements PersistingStoreInterface {
516
516
use ExpiringStoreTrait;
517
517
private array $ keys = [];
@@ -552,7 +552,7 @@ public function putOffExpiration(Key $key, $ttl): void
552
552
553
553
public function testAcquireReadBlockingWithBlockingSharedLockStoreInterface ()
554
554
{
555
- $ key = new Key (uniqid ( __METHOD__ , true ) );
555
+ $ key = new Key (__METHOD__ );
556
556
$ store = $ this ->createMock (BlockingSharedLockStoreInterface::class);
557
557
$ lock = new Lock ($ key , $ store );
558
558
@@ -568,7 +568,7 @@ public function testAcquireReadBlockingWithBlockingSharedLockStoreInterface()
568
568
569
569
public function testAcquireReadBlockingWithSharedLockStoreInterface ()
570
570
{
571
- $ key = new Key (uniqid ( __METHOD__ , true ) );
571
+ $ key = new Key (__METHOD__ );
572
572
$ store = $ this ->createMock (SharedLockStoreInterface::class);
573
573
$ lock = new Lock ($ key , $ store );
574
574
@@ -590,7 +590,7 @@ public function testAcquireReadBlockingWithSharedLockStoreInterface()
590
590
591
591
public function testAcquireReadBlockingWithBlockingLockStoreInterface ()
592
592
{
593
- $ key = new Key (uniqid ( __METHOD__ , true ) );
593
+ $ key = new Key (__METHOD__ );
594
594
$ store = $ this ->createMock (BlockingStoreInterface::class);
595
595
$ lock = new Lock ($ key , $ store );
596
596
@@ -606,7 +606,7 @@ public function testAcquireReadBlockingWithBlockingLockStoreInterface()
606
606
607
607
public function testAcquireReadBlockingWithPersistingStoreInterface ()
608
608
{
609
- $ key = new Key (uniqid ( __METHOD__ , true ) );
609
+ $ key = new Key (__METHOD__ );
610
610
$ store = $ this ->createMock (PersistingStoreInterface::class);
611
611
$ lock = new Lock ($ key , $ store );
612
612
0 commit comments