19
19
use Magento \Config \Model \Config \Structure \Element \Field ;
20
20
use Magento \Config \Model \Config \Structure \Element \Group ;
21
21
use Magento \Config \Model \Config \Structure \Element \Section ;
22
- use Magento \Config \Model \Config \Structure \ElementInterface ;
23
22
use Magento \Email \Block \Adminhtml \Template \Edit ;
24
23
use Magento \Email \Model \BackendTemplate ;
24
+ use Magento \Framework \App \Config \ScopeConfigInterface ;
25
25
use Magento \Framework \App \Filesystem \DirectoryList ;
26
+ use Magento \Framework \App \State ;
26
27
use Magento \Framework \Event \ManagerInterface ;
27
28
use Magento \Framework \Filesystem ;
28
29
use Magento \Framework \Filesystem \Directory \Read ;
31
32
use Magento \Framework \Registry ;
32
33
use Magento \Framework \Serialize \SerializerInterface ;
33
34
use Magento \Framework \UrlInterface ;
35
+ use Magento \Framework \View \Element \Template \File \Resolver ;
36
+ use Magento \Framework \View \Element \Template \File \Validator ;
34
37
use Magento \Framework \View \FileSystem as FilesystemView ;
35
38
use Magento \Framework \View \Layout ;
36
39
use Magento \Store \Model \StoreManagerInterface ;
@@ -122,6 +125,22 @@ protected function setUp(): void
122
125
$ this ->context ->expects ($ this ->any ())->method ('getUrlBuilder ' )->willReturn ($ urlBuilder );
123
126
$ eventManager = $ this ->createMock (ManagerInterface::class);
124
127
$ this ->context ->expects ($ this ->any ())->method ('getEventManager ' )->willReturn ($ eventManager );
128
+ $ scopeConfig = $ this ->createMock (ScopeConfigInterface::class);
129
+ $ this ->context ->expects ($ this ->any ())->method ('getScopeConfig ' )->willReturn ($ scopeConfig );
130
+ $ appState = $ this ->createMock (State::class);
131
+ $ this ->context ->expects ($ this ->any ())->method ('getAppState ' )->willReturn ($ appState );
132
+ $ resolver = $ this ->createMock (Resolver::class);
133
+ $ this ->context ->expects ($ this ->any ())->method ('getResolver ' )->willReturn ($ resolver );
134
+ $ fileSystem = $ this ->createMock (Filesystem::class);
135
+ $ fileSystem ->expects ($ this ->any ())
136
+ ->method ('getDirectoryRead ' )
137
+ ->willReturn ($ this ->createMock (Read::class));
138
+ $ this ->context ->expects ($ this ->any ())->method ('getFilesystem ' )->willReturn ($ fileSystem );
139
+ $ validator = $ this ->createMock (Validator::class);
140
+ $ this ->context ->expects ($ this ->any ())->method ('getValidator ' )->willReturn ($ validator );
141
+ $ this ->context ->expects ($ this ->any ())
142
+ ->method ('getLogger ' )
143
+ ->willReturn ($ this ->createMock (LoggerInterface::class));
125
144
126
145
$ urlBuilder ->expects ($ this ->any ())->method ('getUrl ' )->willReturnArgument (0 );
127
146
$ menuConfigMock ->expects ($ this ->any ())->method ('getMenu ' )->willReturn ($ menuMock );
@@ -132,11 +151,6 @@ protected function setUp(): void
132
151
133
152
$ encoder = $ this ->createMock (EncoderInterface::class);
134
153
$ registry = $ this ->createMock (Registry::class);
135
- $ structure = $ this ->createMock (Structure::class);
136
- $ element = $ this ->createMock (ElementInterface::class);
137
- $ structure ->expects ($ this ->any ())
138
- ->method ('getElement ' )
139
- ->willReturn ($ element );
140
154
$ jsonHelper = $ this ->createMock (JsonHelper::class);
141
155
$ buttonList = $ this ->createMock (ButtonList::class);
142
156
$ toolbar = $ this ->createMock (ToolbarInterface::class);
@@ -145,11 +159,14 @@ protected function setUp(): void
145
159
$ encoder ,
146
160
$ registry ,
147
161
$ menuConfigMock ,
148
- $ structure ,
162
+ $ this -> _configStructureMock ,
149
163
$ this ->_emailConfigMock ,
150
164
$ jsonHelper ,
151
165
$ buttonList ,
152
- $ toolbar
166
+ $ toolbar ,
167
+ [
168
+ 'directoryHelper ' => $ this ->createMock (\Magento \Directory \Helper \Data::class)
169
+ ]
153
170
);
154
171
}
155
172
@@ -180,6 +197,7 @@ public function testGetCurrentlyUsedForPaths()
180
197
['getLabel ' ]
181
198
);
182
199
$ map = [
200
+ [['section1 ' ], $ sectionMock ],
183
201
[['section1 ' , 'group1 ' ], $ groupMock1 ],
184
202
[['section1 ' , 'group1 ' , 'group2 ' ], $ groupMock2 ],
185
203
[['section1 ' , 'group1 ' , 'group2 ' , 'group3 ' ], $ groupMock3 ],
0 commit comments