Skip to content

Commit 6bc464e

Browse files
committed
MAGETWO-69857: Issue with importing customer address
1 parent b01dbd9 commit 6bc464e

File tree

1 file changed

+31
-1
lines changed

1 file changed

+31
-1
lines changed

app/code/Magento/ImportExport/Test/Unit/Model/Import/EntityAbstractTest.php renamed to app/code/Magento/ImportExport/Test/Unit/Model/Import/AbstractEntityTest.php

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414
use Magento\ImportExport\Model\Import\AbstractEntity;
1515

16-
class EntityAbstractTest extends \Magento\ImportExport\Test\Unit\Model\Import\AbstractImportTestCase
16+
class AbstractEntityTest extends \Magento\ImportExport\Test\Unit\Model\Import\AbstractImportTestCase
1717
{
1818
/**
1919
* Abstract import entity model
@@ -402,6 +402,36 @@ public function testIsAttributeValid(array $data)
402402
$this->assertEquals(1, $this->_model->getErrorAggregator()->getErrorsCount(), 'Wrong count of errors');
403403
}
404404

405+
/**
406+
* Test for method isAttributeValid() for multiselect attribute with custom separator.
407+
*
408+
* @return void
409+
*/
410+
public function testMultiSelectIsAttributeValidWithCustomSeparator()
411+
{
412+
$data = $this->_getDataSet(
413+
'test3',
414+
'select',
415+
'1;3',
416+
'custom',
417+
null,
418+
[1 => 'test1', 2 => 'test2', 3 => 'test3']
419+
);
420+
$attributeCode = $data['code'];
421+
$attributeParams = [
422+
'type' => $data['type'],
423+
'options' => isset($data['options']) ? $data['options'] : null,
424+
'is_unique' => isset($data['is_unique']) ? $data['is_unique'] : null,
425+
];
426+
427+
$rowData = [$attributeCode => $data['valid_value']];
428+
$this->assertTrue($this->_model->isAttributeValid($attributeCode, $attributeParams, $rowData, 0, ';'));
429+
430+
$rowData[$attributeCode] = $data['invalid_value'];
431+
$this->assertFalse($this->_model->isAttributeValid($attributeCode, $attributeParams, $rowData, 0, ';'));
432+
$this->assertEquals(1, $this->_model->getErrorAggregator()->getErrorsCount(), 'Wrong count of errors');
433+
}
434+
405435
/**
406436
* Data provide which retrieve data for test attributes
407437
*

0 commit comments

Comments
 (0)