Skip to content
This repository was archived by the owner on Apr 29, 2019. It is now read-only.

Commit df87cda

Browse files
committed
MAGETWO-70332: [GitHub] Accessing url with ___store= creates exception #9433
1 parent 2a7c7cb commit df87cda

File tree

2 files changed

+23
-23
lines changed

2 files changed

+23
-23
lines changed

app/code/Magento/Store/App/Action/Plugin/Context.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ private function updateContext(StoreInterface $store)
149149
}
150150

151151
/**
152-
* Check if there a need to find the current store.
152+
* Check if there is a need to find the current store.
153153
*
154154
* @return bool
155155
*/

app/code/Magento/Store/Test/Unit/App/Action/Plugin/ContextTest.php

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -112,24 +112,24 @@ protected function setUp()
112112
->willReturn($this->storeMock);
113113
$this->storeCookieManager->expects($this->once())
114114
->method('getStoreCodeFromCookie')
115-
->will($this->returnValue('storeCookie'));
115+
->willReturn('storeCookie');
116116
$this->currentStoreMock->expects($this->any())
117117
->method('getDefaultCurrencyCode')
118-
->will($this->returnValue(self::CURRENCY_CURRENT_STORE));
118+
->willReturn(self::CURRENCY_CURRENT_STORE);
119119
}
120120

121121
public function testBeforeDispatchCurrencyFromSession()
122122
{
123123
$this->storeManager->expects($this->once())
124124
->method('getWebsite')
125-
->will($this->returnValue($this->websiteMock));
125+
->willReturn($this->websiteMock);
126126
$this->websiteMock->expects($this->once())
127127
->method('getDefaultStore')
128-
->will($this->returnValue($this->storeMock));
128+
->willReturn($this->storeMock);
129129

130130
$this->storeMock->expects($this->once())
131131
->method('getDefaultCurrencyCode')
132-
->will($this->returnValue(self::CURRENCY_DEFAULT));
132+
->willReturn(self::CURRENCY_DEFAULT);
133133

134134
$this->storeMock->expects($this->once())
135135
->method('getCode')
@@ -141,15 +141,15 @@ public function testBeforeDispatchCurrencyFromSession()
141141
$this->requestMock->expects($this->once())
142142
->method('getParam')
143143
->with($this->equalTo('___store'))
144-
->will($this->returnValue('default'));
144+
->willReturn('default');
145145

146146
$this->storeManager->method('getStore')
147147
->with('default')
148148
->willReturn($this->currentStoreMock);
149149

150150
$this->sessionMock->expects($this->any())
151151
->method('getCurrencyCode')
152-
->will($this->returnValue(self::CURRENCY_SESSION));
152+
->willReturn(self::CURRENCY_SESSION);
153153

154154
$this->httpContextMock->expects($this->at(1))
155155
->method('setValue')
@@ -177,14 +177,14 @@ public function testDispatchCurrentStoreCurrency()
177177
{
178178
$this->storeManager->expects($this->once())
179179
->method('getWebsite')
180-
->will($this->returnValue($this->websiteMock));
180+
->willReturn($this->websiteMock);
181181
$this->websiteMock->expects($this->once())
182182
->method('getDefaultStore')
183-
->will($this->returnValue($this->storeMock));
183+
->willReturn($this->storeMock);
184184

185185
$this->storeMock->expects($this->once())
186186
->method('getDefaultCurrencyCode')
187-
->will($this->returnValue(self::CURRENCY_DEFAULT));
187+
->willReturn(self::CURRENCY_DEFAULT);
188188

189189
$this->storeMock->expects($this->once())
190190
->method('getCode')
@@ -196,7 +196,7 @@ public function testDispatchCurrentStoreCurrency()
196196
$this->requestMock->expects($this->once())
197197
->method('getParam')
198198
->with($this->equalTo('___store'))
199-
->will($this->returnValue('default'));
199+
->willReturn('default');
200200

201201
$this->storeManager->method('getStore')
202202
->with('default')
@@ -229,14 +229,14 @@ public function testDispatchStoreParameterIsArray()
229229
{
230230
$this->storeManager->expects($this->once())
231231
->method('getWebsite')
232-
->will($this->returnValue($this->websiteMock));
232+
->willReturn($this->websiteMock);
233233
$this->websiteMock->expects($this->once())
234234
->method('getDefaultStore')
235-
->will($this->returnValue($this->storeMock));
235+
->willReturn($this->storeMock);
236236

237237
$this->storeMock->expects($this->once())
238238
->method('getDefaultCurrencyCode')
239-
->will($this->returnValue(self::CURRENCY_DEFAULT));
239+
->willReturn(self::CURRENCY_DEFAULT);
240240

241241
$this->storeMock->expects($this->once())
242242
->method('getCode')
@@ -254,7 +254,7 @@ public function testDispatchStoreParameterIsArray()
254254
$this->requestMock->expects($this->once())
255255
->method('getParam')
256256
->with($this->equalTo('___store'))
257-
->will($this->returnValue($store));
257+
->willReturn($store);
258258

259259
$this->storeManager->expects($this->once())
260260
->method('getStore')
@@ -291,13 +291,13 @@ public function testDispatchStoreParameterIsInvalidArray()
291291
{
292292
$this->storeManager->expects($this->once())
293293
->method('getWebsite')
294-
->will($this->returnValue($this->websiteMock));
294+
->willReturn($this->websiteMock);
295295
$this->websiteMock->expects($this->once())
296296
->method('getDefaultStore')
297-
->will($this->returnValue($this->storeMock));
297+
->willReturn($this->storeMock);
298298
$this->storeMock->expects($this->exactly(2))
299299
->method('getDefaultCurrencyCode')
300-
->will($this->returnValue(self::CURRENCY_DEFAULT));
300+
->willReturn(self::CURRENCY_DEFAULT);
301301

302302
$this->storeMock->expects($this->exactly(2))
303303
->method('getCode')
@@ -315,7 +315,7 @@ public function testDispatchStoreParameterIsInvalidArray()
315315
$this->requestMock->expects($this->once())
316316
->method('getParam')
317317
->with($this->equalTo('___store'))
318-
->will($this->returnValue($store));
318+
->willReturn($store);
319319
$this->storeManager->expects($this->once())
320320
->method('getStore')
321321
->with()
@@ -347,13 +347,13 @@ public function testDispatchNonExistingStore()
347347
->willReturn($this->storeMock);
348348
$this->storeManager->expects($this->once())
349349
->method('getWebsite')
350-
->will($this->returnValue($this->websiteMock));
350+
->willReturn($this->websiteMock);
351351
$this->websiteMock->expects($this->once())
352352
->method('getDefaultStore')
353-
->will($this->returnValue($this->storeMock));
353+
->willReturn($this->storeMock);
354354
$this->storeMock->expects($this->exactly(2))
355355
->method('getDefaultCurrencyCode')
356-
->will($this->returnValue(self::CURRENCY_DEFAULT));
356+
->willReturn(self::CURRENCY_DEFAULT);
357357

358358
$this->storeMock->expects($this->exactly(2))
359359
->method('getCode')

0 commit comments

Comments
 (0)