Skip to content

Commit 63682a0

Browse files
committed
Fix test with willReturnMap
1 parent 1e82777 commit 63682a0

File tree

1 file changed

+8
-14
lines changed

1 file changed

+8
-14
lines changed

app/code/Magento/Store/Test/Unit/Controller/Store/RedirectTest.php

100644100755
Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -146,20 +146,14 @@ protected function setUp()
146146
public function testRedirect(string $defaultStoreViewCode, string $storeCode): void
147147
{
148148
$this->requestMock
149-
->expects($this->at(0))
150-
->method('getParam')
151-
->with(StoreResolver::PARAM_NAME)
152-
->willReturn($storeCode);
153-
$this->requestMock
154-
->expects($this->at(1))
155-
->method('getParam')
156-
->with('___from_store')
157-
->willReturn($defaultStoreViewCode);
158-
$this->requestMock
159-
->expects($this->at(2))
160-
->method('getParam')
161-
->with(ActionInterface::PARAM_NAME_URL_ENCODED)
162-
->willReturn($defaultStoreViewCode);
149+
->expects($this->any())
150+
->method('getParam')->willReturnMap(
151+
[
152+
[StoreResolver::PARAM_NAME, null, $storeCode],
153+
['___from_store', null, $defaultStoreViewCode],
154+
[ActionInterface::PARAM_NAME_URL_ENCODED, null, $defaultStoreViewCode]
155+
]
156+
);
163157
$this->storeRepositoryMock
164158
->expects($this->once())
165159
->method('get')

0 commit comments

Comments
 (0)