Skip to content

Commit f72c91f

Browse files
author
Stanislav Idolov
committed
- static fixes
1 parent 1470377 commit f72c91f

File tree

1 file changed

+18
-54
lines changed

1 file changed

+18
-54
lines changed

app/code/Magento/Customer/Test/Unit/Model/Account/RedirectTest.php

Lines changed: 18 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -191,57 +191,31 @@ public function testGetRedirect(
191191
$redirectToDashboard
192192
) {
193193
// Preparations for method updateLastCustomerId()
194-
$this->customerSession->expects($this->once())
195-
->method('getLastCustomerId')
196-
->willReturn($customerId);
197-
$this->customerSession->expects($this->any())
198-
->method('isLoggedIn')
199-
->willReturn($customerLoggedIn);
200-
$this->customerSession->expects($this->any())
201-
->method('getId')
202-
->willReturn($lastCustomerId);
203-
$this->customerSession->expects($this->any())
204-
->method('unsBeforeAuthUrl')
205-
->willReturnSelf();
194+
$this->customerSession->expects($this->once())->method('getLastCustomerId')->willReturn($customerId);
195+
$this->customerSession->expects($this->any())->method('isLoggedIn')->willReturn($customerLoggedIn);
196+
$this->customerSession->expects($this->any())->method('getId')->willReturn($lastCustomerId);
197+
$this->customerSession->expects($this->any())->method('unsBeforeAuthUrl')->willReturnSelf();
206198
$this->customerSession->expects($this->any())
207199
->method('setLastCustomerId')
208200
->with($lastCustomerId)
209201
->willReturnSelf();
210202

211203
// Preparations for method prepareRedirectUrl()
212-
$this->store->expects($this->once())
213-
->method('getBaseUrl')
214-
->willReturn($baseUrl);
204+
$this->store->expects($this->once())->method('getBaseUrl')->willReturn($baseUrl);
215205

216-
$this->customerSession->expects($this->any())
217-
->method('getBeforeAuthUrl')
218-
->willReturn($beforeAuthUrl);
219-
$this->customerSession->expects($this->any())
220-
->method('setBeforeAuthUrl')
221-
->willReturnSelf();
222-
$this->customerSession->expects($this->any())
223-
->method('getAfterAuthUrl')
224-
->willReturn($afterAuthUrl);
206+
$this->customerSession->expects($this->any())->method('getBeforeAuthUrl')->willReturn($beforeAuthUrl);
207+
$this->customerSession->expects($this->any())->method('setBeforeAuthUrl')->willReturnSelf();
208+
$this->customerSession->expects($this->any())->method('getAfterAuthUrl')->willReturn($afterAuthUrl);
225209
$this->customerSession->expects($this->any())
226210
->method('setAfterAuthUrl')
227211
->with($beforeAuthUrl)
228212
->willReturnSelf();
229-
$this->customerSession->expects($this->any())
230-
->method('getBeforeRequestParams')
231-
->willReturn(false);
232-
233-
$this->customerUrl->expects($this->any())
234-
->method('getAccountUrl')
235-
->willReturn($accountUrl);
236-
$this->customerUrl->expects($this->any())
237-
->method('getLoginUrl')
238-
->willReturn($loginUrl);
239-
$this->customerUrl->expects($this->any())
240-
->method('getLogoutUrl')
241-
->willReturn($logoutUrl);
242-
$this->customerUrl->expects($this->any())
243-
->method('getDashboardUrl')
244-
->willReturn($dashboardUrl);
213+
$this->customerSession->expects($this->any())->method('getBeforeRequestParams')->willReturn(false);
214+
215+
$this->customerUrl->expects($this->any())->method('getAccountUrl')->willReturn($accountUrl);
216+
$this->customerUrl->expects($this->any())->method('getLoginUrl')->willReturn($loginUrl);
217+
$this->customerUrl->expects($this->any())->method('getLogoutUrl')->willReturn($logoutUrl);
218+
$this->customerUrl->expects($this->any())->method('getDashboardUrl')->willReturn($dashboardUrl);
245219

246220
$this->scopeConfig->expects($this->any())
247221
->method('isSetFlag')
@@ -253,28 +227,18 @@ public function testGetRedirect(
253227
->with(CustomerUrl::REFERER_QUERY_PARAM_NAME)
254228
->willReturn($referer);
255229

256-
$this->urlDecoder->expects($this->any())
257-
->method('decode')
258-
->with($referer)
259-
->willReturn($referer);
230+
$this->urlDecoder->expects($this->any())->method('decode')->with($referer)->willReturn($referer);
260231

261-
$this->url->expects($this->any())
262-
->method('isOwnOriginUrl')
263-
->willReturn(true);
232+
$this->url->expects($this->any())->method('isOwnOriginUrl')->willReturn(true);
264233

265-
$this->resultRedirect->expects($this->once())
266-
->method('setUrl')
267-
->with($beforeAuthUrl)
268-
->willReturnSelf();
234+
$this->resultRedirect->expects($this->once())->method('setUrl')->with($beforeAuthUrl)->willReturnSelf();
269235

270236
$this->resultFactory->expects($this->once())
271237
->method('create')
272238
->with(ResultFactory::TYPE_REDIRECT)
273239
->willReturn($this->resultRedirect);
274240

275-
$this->hostChecker->expects($this->any())
276-
->method('isOwnOrigin')
277-
->willReturn(true);
241+
$this->hostChecker->expects($this->any())->method('isOwnOrigin')->willReturn(true);
278242

279243
$this->model->getRedirect();
280244
}

0 commit comments

Comments
 (0)