Skip to content

Commit 4d33a75

Browse files
author
vnayda
committed
MAGETWO-58482: [FT] Magento\ConfigurableProduct\Test\TestCase\CreateConfigurableProductEntityTest failed
1 parent 7988331 commit 4d33a75

File tree

3 files changed

+18
-6
lines changed

3 files changed

+18
-6
lines changed

dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Constraint/AssertConfigurableProductPage.php

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -125,15 +125,23 @@ protected function verifyAttributesMatrix($variationsMatrix, $generatedMatrix)
125125
protected function getLowestConfigurablePrice()
126126
{
127127
$price = null;
128-
$configurableOptions = $this->product->getConfigurableAttributesData();
129-
130-
foreach ($configurableOptions['matrix'] as $option) {
131-
$price = $price === null ? $option['price'] : $price;
132-
if ($price > $option['price']) {
133-
$price = $option['price'];
128+
$priceDataConfig = $this->product->getDataFieldConfig('price');
129+
if (isset($priceDataConfig['source'])) {
130+
$priceData = $priceDataConfig['source']->getPriceData();
131+
if (isset($priceData['price_from'])) {
132+
$price = $priceData['price_from'];
134133
}
135134
}
136135

136+
if (null === $price) {
137+
$configurableOptions = $this->product->getConfigurableAttributesData();
138+
foreach ($configurableOptions['matrix'] as $option) {
139+
$price = $price === null ? $option['price'] : $price;
140+
if ($price > $option['price']) {
141+
$price = $option['price'];
142+
}
143+
}
144+
}
137145
return $price;
138146
}
139147
}

dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Repository/ConfigurableProduct/Price.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,8 @@
1717
<dataset name="MAGETWO-12620">
1818
<field name="category_price" xsi:type="string">11</field>
1919
</dataset>
20+
<dataset name="from-9">
21+
<field name="price_from" xsi:type="string">9</field>
22+
</dataset>
2023
</repository>
2124
</config>

dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/TestCase/CreateConfigurableProductEntityTest.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@
5858
<data name="product/data/checkout_data/dataset" xsi:type="string">configurable_two_new_options_with_special_price</data>
5959
<data name="product/data/name" xsi:type="string">Configurable Product %isolation%</data>
6060
<data name="product/data/sku" xsi:type="string">configurable_sku_%isolation%</data>
61+
<data name="product/data/price/dataset" xsi:type="string">from-9</data>
6162
<data name="product/data/price/value" xsi:type="string">100</data>
6263
<data name="product/data/special_price" xsi:type="string">9</data>
6364
<data name="product/data/short_description" xsi:type="string">Configurable short description</data>

0 commit comments

Comments
 (0)