File tree Expand file tree Collapse file tree 2 files changed +15
-5
lines changed
CustomerImportExport/Test/Unit/Model/Export
ImportExport/Model/Export/Entity Expand file tree Collapse file tree 2 files changed +15
-5
lines changed Original file line number Diff line number Diff line change @@ -38,7 +38,7 @@ class AddressTest extends TestCase
38
38
/**
39
39
* Test attribute code
40
40
*/
41
- const ATTRIBUTE_CODE = 'code1 ' ;
41
+ public const ATTRIBUTE_CODE = 'code1 ' ;
42
42
43
43
/**
44
44
* Websites array (website id => code)
@@ -52,10 +52,16 @@ class AddressTest extends TestCase
52
52
*
53
53
* @var array
54
54
*/
55
- protected $ _attributes = [['attribute_id ' => 1 , 'attribute_code ' => self ::ATTRIBUTE_CODE ]];
55
+ protected $ _attributes = [
56
+ [
57
+ 'attribute_id ' => 1 ,
58
+ 'attribute_code ' => self ::ATTRIBUTE_CODE ,
59
+ 'frontend_input ' => 'multiselect '
60
+ ]
61
+ ];
56
62
57
63
/**
58
- * Customer data
64
+ * Customer details
59
65
*
60
66
* @var array
61
67
*/
@@ -166,8 +172,11 @@ protected function _getModelDependencies()
166
172
true ,
167
173
true ,
168
174
true ,
169
- ['_construct ' ]
175
+ ['_construct ' , ' getSource ' ]
170
176
);
177
+
178
+ $ attributeSource = $ this ->createMock (\Magento \Eav \Model \Entity \Attribute \Source \AbstractSource::class);
179
+ $ attribute ->expects ($ this ->once ())->method ('getSource ' )->willReturn ($ attributeSource );
171
180
$ attributeCollection ->addItem ($ attribute );
172
181
}
173
182
Original file line number Diff line number Diff line change @@ -286,7 +286,8 @@ protected function _addAttributeValuesToRow(\Magento\Framework\Model\AbstractMod
286
286
287
287
if ($ this ->isMultiselect ($ attributeCode )) {
288
288
$ values = [];
289
- $ attributeValue = explode (Import::DEFAULT_GLOBAL_MULTI_VALUE_SEPARATOR , $ attributeValue );
289
+ $ attributeValue =
290
+ $ attributeValue ? explode (Import::DEFAULT_GLOBAL_MULTI_VALUE_SEPARATOR , $ attributeValue ) : [];
290
291
foreach ($ attributeValue as $ value ) {
291
292
$ values [] = $ this ->getAttributeValueById ($ attributeCode , $ value );
292
293
}
You can’t perform that action at this time.
0 commit comments