1919use Magento \Config \Model \Config \Structure \Element \Field ;
2020use Magento \Config \Model \Config \Structure \Element \Group ;
2121use Magento \Config \Model \Config \Structure \Element \Section ;
22- use Magento \Config \Model \Config \Structure \ElementInterface ;
2322use Magento \Email \Block \Adminhtml \Template \Edit ;
2423use Magento \Email \Model \BackendTemplate ;
24+ use Magento \Framework \App \Config \ScopeConfigInterface ;
2525use Magento \Framework \App \Filesystem \DirectoryList ;
26+ use Magento \Framework \App \State ;
2627use Magento \Framework \Event \ManagerInterface ;
2728use Magento \Framework \Filesystem ;
2829use Magento \Framework \Filesystem \Directory \Read ;
3132use Magento \Framework \Registry ;
3233use Magento \Framework \Serialize \SerializerInterface ;
3334use Magento \Framework \UrlInterface ;
35+ use Magento \Framework \View \Element \Template \File \Resolver ;
36+ use Magento \Framework \View \Element \Template \File \Validator ;
3437use Magento \Framework \View \FileSystem as FilesystemView ;
3538use Magento \Framework \View \Layout ;
3639use Magento \Store \Model \StoreManagerInterface ;
@@ -122,6 +125,22 @@ protected function setUp(): void
122125 $ this ->context ->expects ($ this ->any ())->method ('getUrlBuilder ' )->willReturn ($ urlBuilder );
123126 $ eventManager = $ this ->createMock (ManagerInterface::class);
124127 $ 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));
125144
126145 $ urlBuilder ->expects ($ this ->any ())->method ('getUrl ' )->willReturnArgument (0 );
127146 $ menuConfigMock ->expects ($ this ->any ())->method ('getMenu ' )->willReturn ($ menuMock );
@@ -132,11 +151,6 @@ protected function setUp(): void
132151
133152 $ encoder = $ this ->createMock (EncoderInterface::class);
134153 $ 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 );
140154 $ jsonHelper = $ this ->createMock (JsonHelper::class);
141155 $ buttonList = $ this ->createMock (ButtonList::class);
142156 $ toolbar = $ this ->createMock (ToolbarInterface::class);
@@ -145,11 +159,14 @@ protected function setUp(): void
145159 $ encoder ,
146160 $ registry ,
147161 $ menuConfigMock ,
148- $ structure ,
162+ $ this -> _configStructureMock ,
149163 $ this ->_emailConfigMock ,
150164 $ jsonHelper ,
151165 $ buttonList ,
152- $ toolbar
166+ $ toolbar ,
167+ [
168+ 'directoryHelper ' => $ this ->createMock (\Magento \Directory \Helper \Data::class)
169+ ]
153170 );
154171 }
155172
@@ -180,6 +197,7 @@ public function testGetCurrentlyUsedForPaths()
180197 ['getLabel ' ]
181198 );
182199 $ map = [
200+ [['section1 ' ], $ sectionMock ],
183201 [['section1 ' , 'group1 ' ], $ groupMock1 ],
184202 [['section1 ' , 'group1 ' , 'group2 ' ], $ groupMock2 ],
185203 [['section1 ' , 'group1 ' , 'group2 ' , 'group3 ' ], $ groupMock3 ],
0 commit comments