Skip to content

Commit f6597f9

Browse files
author
Gurzhyi, Andrii
committed
MAGETWO-48227: Fix API/Integration tests
- Fixed tests
1 parent d579085 commit f6597f9

File tree

2 files changed

+2
-3
lines changed
  • app/code/Magento/ConfigurableProduct/Model/Product
  • dev/tests/integration/testsuite/Magento/ConfigurableProduct/Model/Product/Type/Configurable

2 files changed

+2
-3
lines changed

app/code/Magento/ConfigurableProduct/Model/Product/ReadHandler.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ private function getLinkedProducts(ProductInterface $product)
9797
$metadata = $this->metadataPool->getMetadata(ProductInterface::class);
9898
/** @var Configurable $typeInstance */
9999
$typeInstance = $product->getTypeInstance();
100-
$childrenIds = $typeInstance->getChildrenIds($product->getData($metadata->getLinkField()));
100+
$childrenIds = $typeInstance->getChildrenIds($product->getId());
101101

102102
if (isset($childrenIds[0])) {
103103
return $childrenIds[0];

dev/tests/integration/testsuite/Magento/ConfigurableProduct/Model/Product/Type/Configurable/PriceTest.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,9 +117,8 @@ public function testGetFinalPriceWithCustomOption()
117117

118118
/** @var \Magento\Catalog\Api\ProductRepositoryInterface $productRepository */
119119
$productRepository = $this->objectManager->get(ProductRepositoryInterface::class);
120-
$productRepository->save($product);
120+
$product = $productRepository->save($product);
121121

122-
$product = $this->getProduct(1);
123122
$optionId = $product->getOptions()[0]->getId();
124123
$product->addCustomOption(AbstractType::OPTION_PREFIX . $optionId, 'text');
125124
$product->addCustomOption('option_ids', $optionId);

0 commit comments

Comments
 (0)