Skip to content

Commit 42be80e

Browse files
NadiyaSvzabaznov
authored andcommitted
MAGETWO-55156: [Backport] If custom text area attribute is created, you can't export bundle product. - for 2.0
- MAGETWO-58104: If custom text area attribute is created, you can't export bundle product. - for 2.2 -- unit test was changed -- (cherry picked from commit edd94d9)
1 parent 43c0cfc commit 42be80e

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed

app/code/Magento/BundleImportExport/Test/Unit/Model/Export/Product/RowCustomizerTest.php

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -59,17 +59,17 @@ protected function setUp()
5959
{
6060
$this->objectManagerHelper = new ObjectManagerHelper($this);
6161
$this->rowCustomizerMock = $this->objectManagerHelper->getObject(
62-
'\Magento\BundleImportExport\Model\Export\RowCustomizer'
62+
\Magento\BundleImportExport\Model\Export\RowCustomizer::class
6363
);
6464
$this->productResourceCollection = $this->getMock(
65-
'\Magento\Catalog\Model\ResourceModel\Product\Collection',
65+
\Magento\Catalog\Model\ResourceModel\Product\Collection::class,
6666
['addAttributeToFilter', 'getIterator'],
6767
[],
6868
'',
6969
false
7070
);
7171
$this->product = $this->getMock(
72-
'\Magento\Catalog\Model\Product',
72+
\Magento\Catalog\Model\Product::class,
7373
[
7474
'getId',
7575
'getPriceType',
@@ -91,7 +91,7 @@ protected function setUp()
9191
$this->product->expects($this->any())->method('getWeightType')->willReturn(1);
9292
$this->product->expects($this->any())->method('getTypeInstance')->willReturnSelf();
9393
$this->optionsCollection = $this->getMock(
94-
'\Magento\Bundle\Model\ResourceModel\Option\Collection',
94+
\Magento\Bundle\Model\ResourceModel\Option\Collection::class,
9595
['setOrder', 'getIterator'],
9696
[],
9797
'',
@@ -100,7 +100,7 @@ protected function setUp()
100100
$this->product->expects($this->any())->method('getOptionsCollection')->willReturn($this->optionsCollection);
101101
$this->optionsCollection->expects($this->any())->method('setOrder')->willReturnSelf();
102102
$this->option = $this->getMock(
103-
'\Magento\Bundle\Model\Option',
103+
\Magento\Bundle\Model\Option::class,
104104
['getId', 'getTitle', 'getType', 'getRequired'],
105105
[],
106106
'',
@@ -114,7 +114,7 @@ protected function setUp()
114114
$this->returnValue(new \ArrayIterator([$this->option]))
115115
);
116116
$this->selection = $this->getMock(
117-
'\Magento\Catalog\Model\Product',
117+
\Magento\Catalog\Model\Product::class,
118118
['getSku', 'getSelectionPriceValue', 'getIsDefault', 'getSelectionQty', 'getSelectionPriceType'],
119119
[],
120120
'',
@@ -125,7 +125,7 @@ protected function setUp()
125125
$this->selection->expects($this->any())->method('getSelectionQty')->willReturn(1);
126126
$this->selection->expects($this->any())->method('getSelectionPriceType')->willReturn(1);
127127
$this->selectionsCollection = $this->getMock(
128-
'\Magento\Bundle\Model\ResourceModel\Selection\Collection',
128+
\Magento\Bundle\Model\ResourceModel\Selection\Collection::class,
129129
['getIterator', 'addAttributeToSort'],
130130
[],
131131
'',
@@ -175,14 +175,16 @@ public function testAddHeaderColumns()
175175
public function testAddData()
176176
{
177177
$preparedData = $this->rowCustomizerMock->prepareData($this->productResourceCollection, [1]);
178+
$attributes = 'attribute=1,sku_type=1,attribute2="Text",price_type=1,price_view=1,weight_type=1,'
179+
. 'values=values,shipment_type=1,attribute3=One,Two,Three';
178180
$dataRow = [
179181
'sku' => 'sku1',
180-
'additional_attributes' => 'attribute=1,sku_type=1,price_type=1,price_view=1,weight_type=1,values=values'
182+
'additional_attributes' => $attributes
181183
];
182184
$preparedRow = $preparedData->addData($dataRow, 1);
183185
$expected = [
184186
'sku' => 'sku1',
185-
'additional_attributes' => 'attribute=1',
187+
'additional_attributes' => 'attribute=1,attribute2="Text",attribute3=One,Two,Three',
186188
'bundle_price_type' => 'fixed',
187189
'bundle_sku_type' => 'fixed',
188190
'bundle_price_view' => 'As low as',

dev/tests/integration/testsuite/Magento/CatalogImportExport/Model/Import/_files/products_to_import_with_custom_attributes.csv

Lines changed: 0 additions & 2 deletions
This file was deleted.

0 commit comments

Comments
 (0)