@@ -76,51 +76,6 @@ public function testNoRewriteExist()
76
76
$ this ->assertNull ($ this ->router ->match ($ this ->request ));
77
77
}
78
78
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
-
124
79
public function testNoRewriteAfterStoreSwitcherWhenNoOldRewrite ()
125
80
{
126
81
$ this ->request ->expects ($ this ->any ())->method ('getPathInfo ' )->will ($ this ->returnValue ('request-path ' ));
0 commit comments