Skip to content

Commit 4521499

Browse files
author
Roman Lytvynenko
committed
MAGETWO-99491: Configurable options attribute position is not saved correctly via API
1 parent 8b141ed commit 4521499

File tree

1 file changed

+16
-5
lines changed

1 file changed

+16
-5
lines changed

dev/tests/api-functional/testsuite/Magento/ConfigurableProduct/Api/LinkManagementTest.php

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -93,15 +93,18 @@ public function testAddChildFullRestCreation()
9393
$this->createConfigurableProduct($productSku);
9494
$attribute = $this->attributeRepository->get('catalog_product', 'test_configurable');
9595

96-
$this->addOptionToConfigurableProduct($productSku, $attribute->getAttributeId(),
96+
$this->addOptionToConfigurableProduct(
97+
$productSku,
98+
$attribute->getAttributeId(),
9799
[
98100
[
99101
'value_index' => $attribute->getOptions()[1]->getValue()
100102
]
101103
]
102104
);
103105

104-
$this->createSimpleProduct($childSku,
106+
$this->createSimpleProduct(
107+
$childSku,
105108
[
106109
[
107110
'attribute_code' => 'test_configurable',
@@ -168,7 +171,12 @@ public function testConfigurableOptionPositionPreservation()
168171
foreach ($options as $option) {
169172
$valueIndexesData []['value_index']= $option->getValue();
170173
}
171-
$this->addOptionToConfigurableProduct($productSku, $attribute->getAttributeId(), $valueIndexesData, $position);
174+
$this->addOptionToConfigurableProduct(
175+
$productSku,
176+
$attribute->getAttributeId(),
177+
$valueIndexesData,
178+
$position
179+
);
172180
$position++;
173181
}
174182

@@ -210,7 +218,9 @@ public function testConfigurableOptionPositionPreservation()
210218
$childProductsDiff = array_diff(
211219
$childProductSkus,
212220
array_column(
213-
$this->getChildren($productSku), 'sku')
221+
$this->getChildren($productSku),
222+
'sku'
223+
)
214224
);
215225
$this->assertCount(0, $childProductsDiff, 'Added child product count mismatch expected result');
216226

@@ -241,7 +251,8 @@ public function testConfigurableOptionPositionPreservation()
241251
* @param string $sku
242252
* @return bool
243253
*/
244-
private function deleteProduct(string $sku): bool {
254+
private function deleteProduct(string $sku): bool
255+
{
245256
$serviceInfo = [
246257
'rest' => [
247258
'resourcePath' => '/V1/products/' . $sku,

0 commit comments

Comments
 (0)