Skip to content

Commit 6cee697

Browse files
committed
Merge branch 'ACP2E-1736' of https://github.com/magento-l3/magento2ce into PR-L3-03132023
2 parents 24e9f6b + bdc3583 commit 6cee697

File tree

2 files changed

+15
-5
lines changed

2 files changed

+15
-5
lines changed

app/code/Magento/CustomerImportExport/Test/Unit/Model/Export/AddressTest.php

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ class AddressTest extends TestCase
3838
/**
3939
* Test attribute code
4040
*/
41-
const ATTRIBUTE_CODE = 'code1';
41+
public const ATTRIBUTE_CODE = 'code1';
4242

4343
/**
4444
* Websites array (website id => code)
@@ -52,10 +52,16 @@ class AddressTest extends TestCase
5252
*
5353
* @var array
5454
*/
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+
];
5662

5763
/**
58-
* Customer data
64+
* Customer details
5965
*
6066
* @var array
6167
*/
@@ -166,8 +172,11 @@ protected function _getModelDependencies()
166172
true,
167173
true,
168174
true,
169-
['_construct']
175+
['_construct', 'getSource']
170176
);
177+
178+
$attributeSource = $this->createMock(\Magento\Eav\Model\Entity\Attribute\Source\AbstractSource::class);
179+
$attribute->expects($this->once())->method('getSource')->willReturn($attributeSource);
171180
$attributeCollection->addItem($attribute);
172181
}
173182

app/code/Magento/ImportExport/Model/Export/Entity/AbstractEav.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,8 @@ protected function _addAttributeValuesToRow(\Magento\Framework\Model\AbstractMod
286286

287287
if ($this->isMultiselect($attributeCode)) {
288288
$values = [];
289-
$attributeValue = explode(Import::DEFAULT_GLOBAL_MULTI_VALUE_SEPARATOR, $attributeValue);
289+
$attributeValue =
290+
$attributeValue ? explode(Import::DEFAULT_GLOBAL_MULTI_VALUE_SEPARATOR, $attributeValue) : [];
290291
foreach ($attributeValue as $value) {
291292
$values[] = $this->getAttributeValueById($attributeCode, $value);
292293
}

0 commit comments

Comments
 (0)