@@ -282,7 +282,9 @@ public function testGetCurrentUrl()
282
282
->setValue ('web/url/use_store ' , true , ScopeInterface::SCOPE_STORE , 'secondstore ' );
283
283
284
284
$ this ->model ->load ('admin ' );
285
- $ this ->model ->expects ($ this ->any ())->method ('getUrl ' )->will ($ this ->returnValue ('http://localhost/index.php ' ));
285
+ $ this ->model
286
+ ->expects ($ this ->any ())->method ('getUrl ' )
287
+ ->will ($ this ->returnValue ('http://localhost/index.php ' ));
286
288
$ this ->assertStringEndsWith ('default ' , $ this ->model ->getCurrentUrl ());
287
289
$ this ->assertStringEndsNotWith ('default ' , $ this ->model ->getCurrentUrl (false ));
288
290
@@ -295,9 +297,18 @@ public function testGetCurrentUrl()
295
297
$ product ->setStoreId ($ secondStore ->getId ());
296
298
$ url = $ product ->getUrlInStore ();
297
299
298
- $ this ->assertEquals ('http://localhost/index.php/secondstore/catalog/product/view/id/1/s/simple-product/ ' , $ url );
299
- $ this ->assertEquals ('http://localhost/index.php/secondstore/?___from_store=default ' , $ secondStore ->getCurrentUrl ());
300
- $ this ->assertEquals ('http://localhost/index.php/secondstore/ ' , $ secondStore ->getCurrentUrl (false ));
300
+ $ this ->assertEquals (
301
+ $ secondStore ->getBaseUrl ().'catalog/product/view/id/1/s/simple-product/ ' ,
302
+ $ url
303
+ );
304
+ $ this ->assertEquals (
305
+ $ secondStore ->getBaseUrl ().'?___from_store=default ' ,
306
+ $ secondStore ->getCurrentUrl ()
307
+ );
308
+ $ this ->assertEquals (
309
+ $ secondStore ->getBaseUrl (),
310
+ $ secondStore ->getCurrentUrl (false )
311
+ );
301
312
}
302
313
303
314
/**
@@ -323,13 +334,25 @@ public function testGetCurrentUrlWithUseStoreInUrlFalse()
323
334
324
335
/** @var \Magento\Catalog\Model\CategoryRepository $categoryRepository */
325
336
$ categoryRepository = $ objectManager ->get (\Magento \Catalog \Model \CategoryRepository::class);
326
- $ category = $ categoryRepository ->get (333 ,$ secondStore ->getStoreId ());
327
-
328
- $ this ->assertEquals ('http://localhost/index.php/catalog/category/view/s/category-1/id/333/ ' ,$ category ->getUrl ());
329
- $ this ->assertEquals ('http://localhost/index.php/catalog/product/view/id/333/s/simple-product-three/?___store=fixture_second_store ' , $ url );
330
- $ this ->assertEquals ('http://localhost/index.php/?___store=fixture_second_store&___from_store=default ' , $ secondStore ->getCurrentUrl ());
331
- $ this ->assertEquals ('http://localhost/index.php/?___store=fixture_second_store ' , $ secondStore ->getCurrentUrl (false ));
337
+ $ category = $ categoryRepository ->get (333 , $ secondStore ->getStoreId ());
332
338
339
+ $ this ->assertEquals (
340
+ $ secondStore ->getBaseUrl ().'catalog/category/view/s/category-1/id/333/ ' ,
341
+ $ category ->getUrl ()
342
+ );
343
+ $ this ->assertEquals (
344
+ $ secondStore ->getBaseUrl ().
345
+ 'catalog/product/view/id/333/s/simple-product-three/?___store=fixture_second_store ' ,
346
+ $ url
347
+ );
348
+ $ this ->assertEquals (
349
+ $ secondStore ->getBaseUrl ().'?___store=fixture_second_store&___from_store=default ' ,
350
+ $ secondStore ->getCurrentUrl ()
351
+ );
352
+ $ this ->assertEquals (
353
+ $ secondStore ->getBaseUrl ().'?___store=fixture_second_store ' ,
354
+ $ secondStore ->getCurrentUrl (false )
355
+ );
333
356
}
334
357
335
358
/**
0 commit comments