6
6
namespace Magento \Theme \Test \Unit \Model \Design \Config ;
7
7
8
8
use Magento \Config \Model \Config \Reader \Source \Deployed \SettingChecker ;
9
+ use Magento \Framework \App \Config \ScopeCodeResolver ;
9
10
use Magento \Framework \App \RequestInterface ;
10
11
use Magento \Framework \TestFramework \Unit \Helper \ObjectManager ;
11
- use Magento \Store \Api \Data \StoreInterface ;
12
- use Magento \Store \Model \StoreManagerInterface ;
13
12
use Magento \Theme \Model \Design \Config \DataLoader ;
14
13
use Magento \Theme \Model \Design \Config \DataProvider ;
15
14
use Magento \Theme \Model \Design \Config \MetadataLoader ;
@@ -48,9 +47,9 @@ class DataProviderTest extends \PHPUnit_Framework_TestCase
48
47
private $ requestMock ;
49
48
50
49
/**
51
- * @var StoreManagerInterface |\PHPUnit_Framework_MockObject_MockObject
50
+ * @var ScopeCodeResolver |\PHPUnit_Framework_MockObject_MockObject
52
51
*/
53
- private $ storeManagerMock ;
52
+ private $ scopeCodeResolverMock ;
54
53
55
54
/**
56
55
* @var SettingChecker|\PHPUnit_Framework_MockObject_MockObject
@@ -86,7 +85,7 @@ protected function setUp()
86
85
$ this ->requestMock = $ this ->getMockBuilder (RequestInterface::class)
87
86
->disableOriginalConstructor ()
88
87
->getMock ();
89
- $ this ->storeManagerMock = $ this ->getMockBuilder (StoreManagerInterface ::class)
88
+ $ this ->scopeCodeResolverMock = $ this ->getMockBuilder (ScopeCodeResolver ::class)
90
89
->disableOriginalConstructor ()
91
90
->getMock ();
92
91
$ this ->settingCheckerMock = $ this ->getMockBuilder (SettingChecker::class)
@@ -108,8 +107,8 @@ protected function setUp()
108
107
);
109
108
$ this ->objectManager ->setBackwardCompatibleProperty (
110
109
$ this ->model ,
111
- 'storeManager ' ,
112
- $ this ->storeManagerMock
110
+ 'scopeCodeResolver ' ,
111
+ $ this ->scopeCodeResolverMock
113
112
);
114
113
$ this ->objectManager ->setBackwardCompatibleProperty (
115
114
$ this ->model ,
@@ -139,24 +138,18 @@ public function testGetData()
139
138
*/
140
139
public function testGetMeta (array $ inputMeta , array $ expectedMeta , array $ request )
141
140
{
142
- $ store = $ this ->getMockBuilder (StoreInterface::class)
143
- ->disableOriginalConstructor ()
144
- ->getMock ();
145
- $ store ->expects ($ this ->any ())
146
- ->method ('getCode ' )
147
- ->willReturn ('store1 ' );
148
141
$ this ->requestMock ->expects ($ this ->any ())
149
142
->method ('getParams ' )
150
143
->willReturn ($ request );
151
- $ this ->storeManagerMock ->expects ($ this ->any ())
152
- ->method ('getStore ' )
153
- ->with (1 )
154
- ->willReturn ($ store );
144
+ $ this ->scopeCodeResolverMock ->expects ($ this ->any ())
145
+ ->method ('resolve ' )
146
+ ->with (' stores ' , 1 )
147
+ ->willReturn (' default ' );
155
148
$ this ->settingCheckerMock ->expects ($ this ->any ())
156
149
->method ('isReadOnly ' )
157
150
->withConsecutive (
158
- ['design/head/welcome ' , 'stores ' , 'store1 ' ],
159
- ['design/head/logo ' , 'stores ' , 'store1 ' ]
151
+ ['design/head/welcome ' , 'stores ' , 'default ' ],
152
+ ['design/head/logo ' , 'stores ' , 'default ' ]
160
153
)
161
154
->willReturnOnConsecutiveCalls (
162
155
true ,
0 commit comments