Skip to content

Commit 47f7ddd

Browse files
committed
MAGETWO-80426: Calling the getCustomAttributes() method on a product instance before it is saved, internal _data property structure is changed and extracted incorrectly before saved
- Update unit tests to set custom attribute by CustomAttributesDataInterface;
1 parent bdb1121 commit 47f7ddd

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

app/code/Magento/Catalog/Test/Unit/Model/CategoryTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -550,7 +550,7 @@ public function testGetCustomAttributes()
550550
$this->assertEquals("description", $this->category->getCustomAttribute($descriptionAttributeCode)->getValue());
551551

552552
//Change the attribute value, should reflect in getCustomAttribute
553-
$this->category->setData($descriptionAttributeCode, "new description");
553+
$this->category->setCustomAttribute($descriptionAttributeCode, "new description");
554554
$this->assertEquals(1, count($this->category->getCustomAttributes()));
555555
$this->assertNotNull($this->category->getCustomAttribute($descriptionAttributeCode));
556556
$this->assertEquals(

app/code/Magento/Catalog/Test/Unit/Model/ProductTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1247,7 +1247,7 @@ public function testGetCustomAttributes()
12471247
$this->assertEquals("red", $this->model->getCustomAttribute($colorAttributeCode)->getValue());
12481248

12491249
//Change the attribute value, should reflect in getCustomAttribute
1250-
$this->model->setData($colorAttributeCode, "blue");
1250+
$this->model->setCustomAttribute($colorAttributeCode, "blue");
12511251
$this->assertEquals(1, count($this->model->getCustomAttributes()));
12521252
$this->assertNotNull($this->model->getCustomAttribute($colorAttributeCode));
12531253
$this->assertEquals("blue", $this->model->getCustomAttribute($colorAttributeCode)->getValue());

0 commit comments

Comments
 (0)