@@ -72,7 +72,9 @@ protected function setUp()
72
72
'setAttributeSetFilter '
73
73
]
74
74
);
75
- $ attribute = $ this ->createPartialMock (\Magento \Eav \Model \Entity \Attribute::class, [
75
+ $ attribute = $ this ->createPartialMock (
76
+ \Magento \Eav \Model \Entity \Attribute::class,
77
+ [
76
78
'getAttributeCode ' ,
77
79
'getId ' ,
78
80
'getIsVisible ' ,
@@ -85,7 +87,8 @@ protected function setUp()
85
87
'getDefaultValue ' ,
86
88
'usesSource ' ,
87
89
'getFrontendInput ' ,
88
- ]);
90
+ ]
91
+ );
89
92
$ attribute ->expects ($ this ->any ())->method ('getIsVisible ' )->willReturn (true );
90
93
$ attribute ->expects ($ this ->any ())->method ('getIsGlobal ' )->willReturn (true );
91
94
$ attribute ->expects ($ this ->any ())->method ('getIsRequired ' )->willReturn (true );
@@ -167,21 +170,27 @@ protected function setUp()
167
170
)
168
171
->willReturn ([$ attribute1 , $ attribute2 , $ attribute3 ]);
169
172
170
- $ this ->connection = $ this ->createPartialMock (\Magento \Framework \DB \Adapter \Pdo \Mysql::class, [
173
+ $ this ->connection = $ this ->createPartialMock (
174
+ \Magento \Framework \DB \Adapter \Pdo \Mysql::class,
175
+ [
171
176
'select ' ,
172
177
'fetchAll ' ,
173
178
'fetchPairs ' ,
174
179
'joinLeft ' ,
175
180
'insertOnDuplicate ' ,
176
181
'delete ' ,
177
182
'quoteInto '
178
- ]);
179
- $ this ->select = $ this ->createPartialMock (\Magento \Framework \DB \Select::class, [
183
+ ]
184
+ );
185
+ $ this ->select = $ this ->createPartialMock (
186
+ \Magento \Framework \DB \Select::class,
187
+ [
180
188
'from ' ,
181
189
'where ' ,
182
190
'joinLeft ' ,
183
191
'getConnection ' ,
184
- ]);
192
+ ]
193
+ );
185
194
$ this ->select ->expects ($ this ->any ())->method ('from ' )->will ($ this ->returnSelf ());
186
195
$ this ->select ->expects ($ this ->any ())->method ('where ' )->will ($ this ->returnSelf ());
187
196
$ this ->select ->expects ($ this ->any ())->method ('joinLeft ' )->will ($ this ->returnSelf ());
@@ -197,10 +206,13 @@ protected function setUp()
197
206
->method ('fetchAll ' )
198
207
->will ($ this ->returnValue ($ entityAttributes ));
199
208
200
- $ this ->resource = $ this ->createPartialMock (\Magento \Framework \App \ResourceConnection::class, [
209
+ $ this ->resource = $ this ->createPartialMock (
210
+ \Magento \Framework \App \ResourceConnection::class,
211
+ [
201
212
'getConnection ' ,
202
213
'getTableName ' ,
203
- ]);
214
+ ]
215
+ );
204
216
$ this ->resource ->expects ($ this ->any ())->method ('getConnection ' )->will (
205
217
$ this ->returnValue ($ this ->connection )
206
218
);
@@ -265,9 +277,13 @@ public function testIsRowValidSuccess()
265
277
$ rowNum = 1 ;
266
278
$ this ->entityModel ->expects ($ this ->any ())->method ('getRowScope ' )->willReturn (null );
267
279
$ this ->entityModel ->expects ($ this ->never ())->method ('addRowError ' );
268
- $ this ->setPropertyValue ($ this ->simpleType , '_attributes ' , [
269
- $ rowData [\Magento \CatalogImportExport \Model \Import \Product::COL_ATTR_SET ] => [],
270
- ]);
280
+ $ this ->setPropertyValue (
281
+ $ this ->simpleType ,
282
+ '_attributes ' ,
283
+ [
284
+ $ rowData [\Magento \CatalogImportExport \Model \Import \Product::COL_ATTR_SET ] => [],
285
+ ]
286
+ );
271
287
$ this ->assertTrue ($ this ->simpleType ->isRowValid ($ rowData , $ rowNum ));
272
288
}
273
289
@@ -286,13 +302,17 @@ public function testIsRowValidError()
286
302
'attr_code '
287
303
)
288
304
->willReturnSelf ();
289
- $ this ->setPropertyValue ($ this ->simpleType , '_attributes ' , [
290
- $ rowData [\Magento \CatalogImportExport \Model \Import \Product::COL_ATTR_SET ] => [
291
- 'attr_code ' => [
292
- 'is_required ' => true ,
305
+ $ this ->setPropertyValue (
306
+ $ this ->simpleType ,
307
+ '_attributes ' ,
308
+ [
309
+ $ rowData [\Magento \CatalogImportExport \Model \Import \Product::COL_ATTR_SET ] => [
310
+ 'attr_code ' => [
311
+ 'is_required ' => true ,
312
+ ],
293
313
],
294
- ],
295
- ] );
314
+ ]
315
+ );
296
316
297
317
$ this ->assertFalse ($ this ->simpleType ->isRowValid ($ rowData , $ rowNum ));
298
318
}
0 commit comments