Skip to content

Commit 435d55f

Browse files
committed
Fixed Unit test
1 parent 87d1d2a commit 435d55f

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

app/code/Magento/Sales/Test/Unit/Model/Order/Address/RendererTest.php

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -178,19 +178,17 @@ private function setStoreExpectations(): void
178178
$expected = [$storeMock, $originalStoreMock];
179179
$matcher = $this->exactly(count($expected));
180180
$this->storeManagerMck->expects(self::once())->method('getStore')->willReturn($originalStoreMock);
181-
$this->storeManagerMck->expects($matcher)->method('setCurrentStore')->with(
181+
$this->storeManagerMck->expects(self::any())->method('setCurrentStore')->with(
182182
$this->callback(function ($store) use ($matcher, $expected) {
183-
$this->assertEquals($store, $expected[$matcher->getInvocationCount() - 1]);
183+
$this->assertEquals($store, $expected[$matcher->getInvocationCount()]);
184184
return true;
185185
})
186186
);
187187

188188
// One call to setup the store from the order, and an other one to rollback to the original store value
189-
$expected = [$storeMock, $originalStoreMock];
190-
$matcher = $this->exactly(count($expected));
191-
$this->customerAddressConfigMock->expects($matcher)->method('setStore')->with(
189+
$this->customerAddressConfigMock->expects(self::any())->method('setStore')->with(
192190
$this->callback(function ($store) use ($matcher, $expected) {
193-
$this->assertEquals($store, $expected[$matcher->getInvocationCount() - 1]);
191+
$this->assertEquals($store, $expected[$matcher->getInvocationCount()]);
194192
return true;
195193
})
196194
);

0 commit comments

Comments
 (0)