@@ -160,7 +160,7 @@ public function testGetWebsite()
160
160
/** @var \Magento\Store\Model\Store $model */
161
161
$ model = $ this ->objectManagerHelper ->getObject (
162
162
\Magento \Store \Model \Store::class,
163
- ['websiteRepository ' => $ websiteRepository, ]
163
+ ['websiteRepository ' => $ websiteRepository ]
164
164
);
165
165
$ model ->setWebsiteId ($ websiteId );
166
166
@@ -181,7 +181,7 @@ public function testGetWebsiteIfWebsiteIsNotExist()
181
181
/** @var \Magento\Store\Model\Store $model */
182
182
$ model = $ this ->objectManagerHelper ->getObject (
183
183
\Magento \Store \Model \Store::class,
184
- ['websiteRepository ' => $ websiteRepository, ]
184
+ ['websiteRepository ' => $ websiteRepository ]
185
185
);
186
186
$ model ->setWebsiteId (null );
187
187
@@ -207,7 +207,7 @@ public function testGetGroup()
207
207
/** @var \Magento\Store\Model\Store $model */
208
208
$ model = $ this ->objectManagerHelper ->getObject (
209
209
\Magento \Store \Model \Store::class,
210
- ['groupRepository ' => $ groupRepository, ]
210
+ ['groupRepository ' => $ groupRepository ]
211
211
);
212
212
$ model ->setGroupId ($ groupId );
213
213
@@ -228,7 +228,7 @@ public function testGetGroupIfGroupIsNotExist()
228
228
/** @var \Magento\Store\Model\Store $model */
229
229
$ model = $ this ->objectManagerHelper ->getObject (
230
230
\Magento \Store \Model \Store::class,
231
- ['groupRepository ' => $ groupRepository, ]
231
+ ['groupRepository ' => $ groupRepository ]
232
232
);
233
233
$ model ->setGroupId (null );
234
234
@@ -377,30 +377,31 @@ public function testGetBaseUrlEntryPoint()
377
377
$ configMock = $ this ->getMockForAbstractClass (\Magento \Framework \App \Config \ReinitableConfigInterface::class);
378
378
$ configMock ->expects ($ this ->atLeastOnce ())
379
379
->method ('getValue ' )
380
- ->will ($ this ->returnCallback (
381
- function ($ path , $ scope , $ scopeCode ) use ($ expectedPath ) {
382
- return $ expectedPath == $ path ? 'http://domain.com/ ' . $ path . '/ ' : null ;
383
- }
384
- ));
380
+ ->willReturnCallback (function ($ path , $ scope , $ scopeCode ) use ($ expectedPath ) {
381
+ return $ expectedPath == $ path ? 'http://domain.com/ ' . $ path . '/ ' : null ;
382
+ });
383
+ $ this ->requestMock ->expects ($ this ->once ())
384
+ ->method ('getServer ' )
385
+ ->with ('SCRIPT_FILENAME ' )
386
+ ->willReturn ('test_script.php ' );
387
+
385
388
/** @var \Magento\Store\Model\Store $model */
386
389
$ model = $ this ->objectManagerHelper ->getObject (
387
390
\Magento \Store \Model \Store::class,
388
391
[
389
392
'config ' => $ configMock ,
390
393
'isCustomEntryPoint ' => false ,
394
+ 'request ' => $ this ->requestMock
391
395
]
392
396
);
393
397
$ model ->setCode ('scopeCode ' );
394
398
395
399
$ this ->setUrlModifier ($ model );
396
400
397
- $ server = $ _SERVER ;
398
- $ _SERVER ['SCRIPT_FILENAME ' ] = 'test_script.php ' ;
399
401
$ this ->assertEquals (
400
402
$ expectedBaseUrl ,
401
403
$ model ->getBaseUrl (\Magento \Framework \UrlInterface::URL_TYPE_LINK , false )
402
404
);
403
- $ _SERVER = $ server ;
404
405
}
405
406
406
407
/**
@@ -592,7 +593,7 @@ public function testGetAllowedCurrencies()
592
593
/** @var \Magento\Store\Model\Store $model */
593
594
$ model = $ this ->objectManagerHelper ->getObject (
594
595
\Magento \Store \Model \Store::class,
595
- ['config ' => $ configMock , 'currencyInstalled ' => $ currencyPath, ]
596
+ ['config ' => $ configMock , 'currencyInstalled ' => $ currencyPath ]
596
597
);
597
598
598
599
$ this ->assertEquals ($ expectedResult , $ model ->getAllowedCurrencies ());
@@ -666,8 +667,7 @@ public function isCurrentlySecureDataProvider()
666
667
'unsecure request, no secure base url registered ' => [false , 443 , false , true , null ],
667
668
'unsecure request, not using registered port ' => [false , 80 ],
668
669
'unsecure request, using registered port, not using secure in frontend ' => [false , 443 , false , false ],
669
- 'unsecure request, no secure base url registered, not using secure in frontend ' =>
670
- [false , 443 , false , false , null ],
670
+ 'unsecure request, no secure base url registered, not using secure in frontend ' => [false , 443 , false , false , null ],
671
671
'unsecure request, not using registered port, not using secure in frontend ' => [false , 80 , false , false ],
672
672
];
673
673
}
0 commit comments