Skip to content

Commit 40c4c8a

Browse files
Remove calls to onConsecutiveCalls()
1 parent 09b315b commit 40c4c8a

File tree

1 file changed

+22
-21
lines changed

1 file changed

+22
-21
lines changed

Tests/LockTest.php

+22-21
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ public function testAcquireNoBlocking()
3939
->method('save');
4040
$store
4141
->method('exists')
42-
->willReturnOnConsecutiveCalls(true, false);
42+
->willReturn(true, false);
4343

4444
$this->assertTrue($lock->acquire(false));
4545
}
@@ -55,7 +55,7 @@ public function testAcquireNoBlockingWithPersistingStoreInterface()
5555
->method('save');
5656
$store
5757
->method('exists')
58-
->willReturnOnConsecutiveCalls(true, false);
58+
->willReturn(true, false);
5959

6060
$this->assertTrue($lock->acquire(false));
6161
}
@@ -71,7 +71,7 @@ public function testAcquireBlockingWithPersistingStoreInterface()
7171
->method('save');
7272
$store
7373
->method('exists')
74-
->willReturnOnConsecutiveCalls(true, false);
74+
->willReturn(true, false);
7575

7676
$this->assertTrue($lock->acquire(true));
7777
}
@@ -93,7 +93,7 @@ public function testAcquireBlockingRetryWithPersistingStoreInterface()
9393
});
9494
$store
9595
->method('exists')
96-
->willReturnOnConsecutiveCalls(true, false);
96+
->willReturn(true, false);
9797

9898
$this->assertTrue($lock->acquire(true));
9999
}
@@ -110,7 +110,7 @@ public function testAcquireReturnsFalse()
110110
->willThrowException(new LockConflictedException());
111111
$store
112112
->method('exists')
113-
->willReturnOnConsecutiveCalls(true, false);
113+
->willReturn(true, false);
114114

115115
$this->assertFalse($lock->acquire(false));
116116
}
@@ -127,7 +127,7 @@ public function testAcquireReturnsFalseStoreInterface()
127127
->willThrowException(new LockConflictedException());
128128
$store
129129
->method('exists')
130-
->willReturnOnConsecutiveCalls(true, false);
130+
->willReturn(true, false);
131131

132132
$this->assertFalse($lock->acquire(false));
133133
}
@@ -146,7 +146,7 @@ public function testAcquireBlockingWithBlockingStoreInterface()
146146
->method('waitAndSave');
147147
$store
148148
->method('exists')
149-
->willReturnOnConsecutiveCalls(true, false);
149+
->willReturn(true, false);
150150

151151
$this->assertTrue($lock->acquire(true));
152152
}
@@ -166,7 +166,7 @@ public function testAcquireSetsTtl()
166166
->with($key, 10);
167167
$store
168168
->method('exists')
169-
->willReturnOnConsecutiveCalls(true, false);
169+
->willReturn(true, false);
170170

171171
$lock->acquire();
172172
}
@@ -183,7 +183,7 @@ public function testRefresh()
183183
->with($key, 10);
184184
$store
185185
->method('exists')
186-
->willReturnOnConsecutiveCalls(true, false);
186+
->willReturn(true, false);
187187

188188
$lock->refresh();
189189
}
@@ -200,7 +200,7 @@ public function testRefreshCustom()
200200
->with($key, 20);
201201
$store
202202
->method('exists')
203-
->willReturnOnConsecutiveCalls(true, false);
203+
->willReturn(true, false);
204204

205205
$lock->refresh(20);
206206
}
@@ -214,7 +214,7 @@ public function testIsAquired()
214214
$store
215215
->method('exists')
216216
->with($key)
217-
->willReturnOnConsecutiveCalls(true, false);
217+
->willReturn(true, false);
218218

219219
$this->assertTrue($lock->isAcquired());
220220
}
@@ -267,8 +267,8 @@ public function testReleaseOnDestruction()
267267

268268
$store
269269
->method('exists')
270-
->willReturnOnConsecutiveCalls(true, false)
271-
;
270+
->willReturn(true, false);
271+
272272
$store
273273
->expects($this->once())
274274
->method('delete')
@@ -286,8 +286,8 @@ public function testNoAutoReleaseWhenNotConfigured()
286286

287287
$store
288288
->method('exists')
289-
->willReturnOnConsecutiveCalls(true, false)
290-
;
289+
->willReturn(true, false);
290+
291291
$store
292292
->expects($this->never())
293293
->method('delete')
@@ -313,7 +313,8 @@ public function testReleaseThrowsExceptionWhenDeletionFail()
313313
$store
314314
->expects($this->never())
315315
->method('exists')
316-
->with($key);
316+
->with($key)
317+
->willReturn(true);
317318

318319
$lock->release();
319320
}
@@ -426,7 +427,7 @@ public function testAcquireReadNoBlockingWithSharedLockStoreInterface()
426427
->method('saveRead');
427428
$store
428429
->method('exists')
429-
->willReturnOnConsecutiveCalls(true, false);
430+
->willReturn(true, false);
430431

431432
$this->assertTrue($lock->acquireRead(false));
432433
}
@@ -534,7 +535,7 @@ public function testAcquireReadBlockingWithBlockingSharedLockStoreInterface()
534535
->method('waitAndSaveRead');
535536
$store
536537
->method('exists')
537-
->willReturnOnConsecutiveCalls(true, false);
538+
->willReturn(true, false);
538539

539540
$this->assertTrue($lock->acquireRead(true));
540541
}
@@ -556,7 +557,7 @@ public function testAcquireReadBlockingWithSharedLockStoreInterface()
556557
});
557558
$store
558559
->method('exists')
559-
->willReturnOnConsecutiveCalls(true, false);
560+
->willReturn(true, false);
560561

561562
$this->assertTrue($lock->acquireRead(true));
562563
}
@@ -572,7 +573,7 @@ public function testAcquireReadBlockingWithBlockingLockStoreInterface()
572573
->method('waitAndSave');
573574
$store
574575
->method('exists')
575-
->willReturnOnConsecutiveCalls(true, false);
576+
->willReturn(true, false);
576577

577578
$this->assertTrue($lock->acquireRead(true));
578579
}
@@ -594,7 +595,7 @@ public function testAcquireReadBlockingWithPersistingStoreInterface()
594595
});
595596
$store
596597
->method('exists')
597-
->willReturnOnConsecutiveCalls(true, false);
598+
->willReturn(true, false);
598599

599600
$this->assertTrue($lock->acquireRead(true));
600601
}

0 commit comments

Comments
 (0)