Skip to content

Commit b2ed481

Browse files
committed
MAGE-1281 Removed dependency on PHPUnit version specific invocation counter
1 parent 6cb749b commit b2ed481

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

Test/Unit/Service/ReplicaSettingsHandlerTest.php

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,12 +40,14 @@ public function testSetSettingsWithForwardingEnabledAndMixedSettings(): void
4040
->with($storeId)
4141
->willReturn(true);
4242

43-
$invocations = $this->exactly(2);
44-
$this->connector->expects($invocations)
43+
$invocationCount = 0;
44+
$this->connector->expects($this->exactly(2))
4545
->method('setSettings')
4646
->willReturnCallback(
47-
function($indexOptions, $indexSettings, $forwardToReplicas, $mergeSettings, $mergeFrom) use ($invocations) {
48-
switch ($invocations->numberOfInvocations()) {
47+
function($indexOptions, $indexSettings, $forwardToReplicas, $mergeSettings, $mergeFrom) use (&$invocationCount) {
48+
$invocationCount++;
49+
50+
switch ($invocationCount) {
4951
case 1:
5052
$this->assertEquals(['attributesToRetrieve' => ['name', 'price']], $indexSettings);
5153
$this->assertTrue($forwardToReplicas);

0 commit comments

Comments
 (0)