forked from ConvertGroupsAS/magento2-patches
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathPatch-Magento_Store-emulation.patch
50 lines (47 loc) · 2.18 KB
/
Patch-Magento_Store-emulation.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
--- Model/App/Emulation.php
+++ Model/App/Emulation.php
@@ -195,7 +195,7 @@
[
'area' => $this->_viewDesign->getArea(),
'theme' => $this->_viewDesign->getDesignTheme(),
- 'store' => $this->_storeManager->getStore()->getStoreId(),
+ 'store' => $this->_storeManager->getStore()->getCode(),
]
)->setInitialLocaleCode(
$this->_localeResolver->getLocale()
--- Test/Unit/Model/App/EmulationTest.php
+++ Test/Unit/Model/App/EmulationTest.php
@@ -100,7 +100,7 @@
$this->viewDesignMock = $this->getMockForAbstractClass('Magento\Framework\View\DesignInterface');
$this->storeMock = $this->getMockBuilder('Magento\Store\Model\Store')
->disableOriginalConstructor()
- ->setMethods(['__wakeup', 'getStoreId'])
+ ->setMethods(['__wakeup', 'getStoreId', 'getCode'])
->getMock();
// Stubs
@@ -166,7 +166,7 @@
$initArea = 'initial area';
$initTheme = 'initial design theme';
$initLocale = 'initial locale code';
- $initialStore = 1;
+ $initStoreCode = 'default';
$initTranslateInline = false;
$this->inlineTranslationMock->expects($this->once())
@@ -179,7 +179,7 @@
->method('getDesignTheme')
->willReturn($initTheme);
$this->storeManagerMock->expects($this->any())->method('getStore')->willReturn($this->storeMock);
- $this->storeMock->expects($this->once())->method('getStoreId')->willReturn($initialStore);
+ $this->storeMock->expects($this->once())->method('getCode')->willReturn($initStoreCode);
$this->localeResolverMock->expects($this->once())
->method('getLocale')
->willReturn($initLocale);
@@ -194,7 +194,7 @@
->method('setDesignTheme')
->with($initTheme, $initArea);
$this->storeManagerMock->expects($this->once())
- ->method('setCurrentStore')->with($initialStore);
+ ->method('setCurrentStore')->with($initStoreCode);
$this->localeResolverMock->expects($this->once())
->method('setLocale')
->with($initLocale);