@@ -152,28 +152,22 @@ public function testSaveToCheckAdminSystemConfigChangedSectionEvent()
152
152
public function testSaveToCheckScopeDataSet ()
153
153
{
154
154
$ transactionMock = $ this ->createMock (\Magento \Framework \DB \Transaction::class);
155
-
156
155
$ this ->_transFactoryMock ->expects ($ this ->any ())->method ('create ' )->will ($ this ->returnValue ($ transactionMock ));
157
156
158
157
$ this ->_configLoaderMock ->expects ($ this ->any ())->method ('getConfigByPath ' )->will ($ this ->returnValue ([]));
159
158
160
- $ this ->_eventManagerMock ->expects (
161
- $ this ->at (0 )
162
- )->method (
163
- 'dispatch '
164
- )->with (
165
- $ this ->equalTo ('admin_system_config_changed_section_section ' ),
166
- $ this ->arrayHasKey ('website ' )
167
- );
168
-
169
- $ this ->_eventManagerMock ->expects (
170
- $ this ->at (0 )
171
- )->method (
172
- 'dispatch '
173
- )->with (
174
- $ this ->equalTo ('admin_system_config_changed_section_section ' ),
175
- $ this ->arrayHasKey ('store ' )
176
- );
159
+ $ this ->_eventManagerMock ->expects ($ this ->at (0 ))
160
+ ->method ('dispatch ' )
161
+ ->with (
162
+ $ this ->equalTo ('admin_system_config_changed_section_section ' ),
163
+ $ this ->arrayHasKey ('website ' )
164
+ );
165
+ $ this ->_eventManagerMock ->expects ($ this ->at (0 ))
166
+ ->method ('dispatch ' )
167
+ ->with (
168
+ $ this ->equalTo ('admin_system_config_changed_section_section ' ),
169
+ $ this ->arrayHasKey ('store ' )
170
+ );
177
171
178
172
$ group = $ this ->createMock (\Magento \Config \Model \Config \Structure \Element \Group::class);
179
173
$ group ->method ('getPath ' )->willReturn ('section/1 ' );
@@ -182,51 +176,26 @@ public function testSaveToCheckScopeDataSet()
182
176
$ field ->method ('getGroupPath ' )->willReturn ('section/1 ' );
183
177
$ field ->method ('getId ' )->willReturn ('key ' );
184
178
185
- $ this ->_configStructure ->expects (
186
- $ this ->at (0 )
187
- )->method (
188
- 'getElement '
189
- )->with (
190
- 'section/1 '
191
- )->will (
192
- $ this ->returnValue ($ group )
193
- );
194
- $ this ->_configStructure ->expects (
195
- $ this ->at (1 )
196
- )->method (
197
- 'getElement '
198
- )->with (
199
- 'section/1 '
200
- )->will (
201
- $ this ->returnValue ($ group )
202
- );
203
- $ this ->_configStructure ->expects (
204
- $ this ->at (2 )
205
- )->method (
206
- 'getElement '
207
- )->with (
208
- 'section/1/key '
209
- )->will (
210
- $ this ->returnValue ($ field )
211
- );
212
- $ this ->_configStructure ->expects (
213
- $ this ->at (3 )
214
- )->method (
215
- 'getElement '
216
- )->with (
217
- 'section/1 '
218
- )->will (
219
- $ this ->returnValue ($ group )
220
- );
221
- $ this ->_configStructure ->expects (
222
- $ this ->at (4 )
223
- )->method (
224
- 'getElement '
225
- )->with (
226
- 'section/1/key '
227
- )->will (
228
- $ this ->returnValue ($ field )
229
- );
179
+ $ this ->_configStructure ->expects ($ this ->at (0 ))
180
+ ->method ('getElement ' )
181
+ ->with ('section/1 ' )
182
+ ->will ($ this ->returnValue ($ group ));
183
+ $ this ->_configStructure ->expects ($ this ->at (1 ))
184
+ ->method ('getElement ' )
185
+ ->with ('section/1 ' )
186
+ ->will ($ this ->returnValue ($ group ));
187
+ $ this ->_configStructure ->expects ($ this ->at (2 ))
188
+ ->method ('getElement ' )
189
+ ->with ('section/1/key ' )
190
+ ->will ($ this ->returnValue ($ field ));
191
+ $ this ->_configStructure ->expects ($ this ->at (3 ))
192
+ ->method ('getElement ' )
193
+ ->with ('section/1 ' )
194
+ ->will ($ this ->returnValue ($ group ));
195
+ $ this ->_configStructure ->expects ($ this ->at (4 ))
196
+ ->method ('getElement ' )
197
+ ->with ('section/1/key ' )
198
+ ->will ($ this ->returnValue ($ field ));
230
199
231
200
$ website = $ this ->createMock (\Magento \Store \Model \Website::class);
232
201
$ website ->expects ($ this ->any ())->method ('getCode ' )->will ($ this ->returnValue ('website_code ' ));
@@ -242,12 +211,9 @@ public function testSaveToCheckScopeDataSet()
242
211
\Magento \Framework \App \Config \Value::class,
243
212
['setPath ' , 'addData ' , '__sleep ' , '__wakeup ' ]
244
213
);
245
- $ backendModel ->expects (
246
- $ this ->once ()
247
- )->method (
248
- 'addData '
249
- )->with (
250
- [
214
+ $ backendModel ->expects ($ this ->once ())
215
+ ->method ('addData ' )
216
+ ->with ([
251
217
'field ' => 'key ' ,
252
218
'groups ' => [1 => ['fields ' => ['key ' => ['data ' ]]]],
253
219
'group_id ' => null ,
@@ -256,17 +222,11 @@ public function testSaveToCheckScopeDataSet()
256
222
'scope_code ' => 'website_code ' ,
257
223
'field_config ' => null ,
258
224
'fieldset_data ' => ['key ' => null ],
259
- ]
260
- );
261
- $ backendModel ->expects (
262
- $ this ->once ()
263
- )->method (
264
- 'setPath '
265
- )->with (
266
- 'section/1/key '
267
- )->will (
268
- $ this ->returnValue ($ backendModel )
269
- );
225
+ ]);
226
+ $ backendModel ->expects ($ this ->once ())
227
+ ->method ('setPath ' )
228
+ ->with ('section/1/key ' )
229
+ ->will ($ this ->returnValue ($ backendModel ));
270
230
271
231
$ this ->_dataFactoryMock ->expects ($ this ->any ())->method ('create ' )->will ($ this ->returnValue ($ backendModel ));
272
232
0 commit comments