Skip to content

Commit 3b71c94

Browse files
author
Oleksandr Gorkun
committed
MAGETWO-88091: [GITHUB] [2.1] Store View Language switch leads to 404 on some cases #5416
1 parent f4ddc7e commit 3b71c94

File tree

1 file changed

+0
-45
lines changed

1 file changed

+0
-45
lines changed

app/code/Magento/UrlRewrite/Test/Unit/Controller/RouterTest.php

Lines changed: 0 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -76,51 +76,6 @@ public function testNoRewriteExist()
7676
$this->assertNull($this->router->match($this->request));
7777
}
7878

79-
public function testRewriteAfterStoreSwitcher()
80-
{
81-
$this->request->expects($this->any())->method('getPathInfo')->will($this->returnValue('request-path'));
82-
$this->request->expects($this->any())->method('getParam')->with('___from_store')
83-
->will($this->returnValue('old-store'));
84-
$oldStore = $this->getMockBuilder(\Magento\Store\Model\Store::class)->disableOriginalConstructor()->getMock();
85-
$this->storeManager->expects($this->any())->method('getStore')
86-
->will($this->returnValueMap([['old-store', $oldStore], [null, $this->store]]));
87-
$oldStore->expects($this->any())->method('getId')->will($this->returnValue('old-store-id'));
88-
$this->store->expects($this->any())->method('getId')->will($this->returnValue('current-store-id'));
89-
$oldUrlRewrite = $this->getMockBuilder(\Magento\UrlRewrite\Service\V1\Data\UrlRewrite::class)
90-
->disableOriginalConstructor()->getMock();
91-
$oldUrlRewrite->expects($this->any())->method('getEntityType')->will($this->returnValue('entity-type'));
92-
$oldUrlRewrite->expects($this->any())->method('getEntityId')->will($this->returnValue('entity-id'));
93-
$oldUrlRewrite->expects($this->any())->method('getRequestPath')->will($this->returnValue('old-request-path'));
94-
$urlRewrite = $this->getMockBuilder(\Magento\UrlRewrite\Service\V1\Data\UrlRewrite::class)
95-
->disableOriginalConstructor()->getMock();
96-
$urlRewrite->expects($this->any())->method('getRequestPath')->will($this->returnValue('new-request-path'));
97-
98-
$this->urlFinder->expects($this->any())->method('findOneByData')->will(
99-
$this->returnValueMap([
100-
[
101-
[UrlRewrite::REQUEST_PATH => 'request-path', UrlRewrite::STORE_ID => 'old-store-id'],
102-
$oldUrlRewrite,
103-
],
104-
[
105-
[
106-
UrlRewrite::ENTITY_TYPE => 'entity-type',
107-
UrlRewrite::ENTITY_ID => 'entity-id',
108-
UrlRewrite::STORE_ID => 'current-store-id',
109-
UrlRewrite::IS_AUTOGENERATED => 1,
110-
],
111-
$urlRewrite
112-
],
113-
])
114-
);
115-
$this->response->expects($this->once())->method('setRedirect')
116-
->with('new-request-path', OptionProvider::TEMPORARY);
117-
$this->request->expects($this->once())->method('setDispatched')->with(true);
118-
$this->actionFactory->expects($this->once())->method('create')
119-
->with(\Magento\Framework\App\Action\Redirect::class);
120-
121-
$this->router->match($this->request);
122-
}
123-
12479
public function testNoRewriteAfterStoreSwitcherWhenNoOldRewrite()
12580
{
12681
$this->request->expects($this->any())->method('getPathInfo')->will($this->returnValue('request-path'));

0 commit comments

Comments
 (0)