@@ -446,10 +446,11 @@ public function saveValidationDataProvider()
446
446
/**
447
447
* @param $storeInUrl
448
448
* @param $disableStoreInUrl
449
+ * @param $singleStoreModeEnabled
449
450
* @param $expectedResult
450
451
* @dataProvider isUseStoreInUrlDataProvider
451
452
*/
452
- public function testIsUseStoreInUrl ($ storeInUrl , $ disableStoreInUrl , $ expectedResult )
453
+ public function testIsUseStoreInUrl ($ storeInUrl , $ disableStoreInUrl , $ singleStoreModeEnabled , $ expectedResult )
453
454
{
454
455
$ objectManager = \Magento \TestFramework \Helper \Bootstrap::getObjectManager ();
455
456
$ configMock = $ this ->createMock (\Magento \Framework \App \Config \ReinitableConfigInterface::class);
@@ -459,10 +460,13 @@ public function testIsUseStoreInUrl($storeInUrl, $disableStoreInUrl, $expectedRe
459
460
$ params ['context ' ] = \Magento \TestFramework \Helper \Bootstrap::getObjectManager ()
460
461
->create (\Magento \Framework \Model \Context::class, ['appState ' => $ appStateMock ]);
461
462
462
- $ configMock-> expects ( $ this -> any ())
463
+ $ configMock
463
464
->method ('getValue ' )
464
- ->with ($ this ->stringContains (Store::XML_PATH_STORE_IN_URL ))
465
- ->willReturn ($ storeInUrl );
465
+ ->withConsecutive (
466
+ [$ this ->stringContains (StoreManager::XML_PATH_SINGLE_STORE_MODE_ENABLED )],
467
+ [$ this ->stringContains (Store::XML_PATH_STORE_IN_URL )]
468
+ )
469
+ ->willReturnOnConsecutiveCalls ($ singleStoreModeEnabled , $ storeInUrl );
466
470
467
471
$ params ['config ' ] = $ configMock ;
468
472
$ model = $ objectManager ->create (\Magento \Store \Model \Store::class, $ params );
@@ -477,10 +481,14 @@ public function testIsUseStoreInUrl($storeInUrl, $disableStoreInUrl, $expectedRe
477
481
public function isUseStoreInUrlDataProvider ()
478
482
{
479
483
return [
480
- [true , null , true ],
481
- [false , null , false ],
482
- [true , true , false ],
483
- [true , false , true ]
484
+ [true , null , false , true ],
485
+ [false , null , false , false ],
486
+ [true , true , false , false ],
487
+ [true , false , false , true ],
488
+ [true , null , true , false ],
489
+ [false , null , true , false ],
490
+ [true , true , true , false ],
491
+ [true , false , true , false ]
484
492
];
485
493
}
486
494
0 commit comments