Skip to content
This repository was archived by the owner on Apr 29, 2019. It is now read-only.

Commit 1aa5a61

Browse files
committed
MAGETWO-80898: Create Functional Test to verify if Ordered Products Grid displays child simple products SKU for a configurable product
- Fixed code and code styles per CR comments
1 parent 2b83742 commit 1aa5a61

File tree

5 files changed

+11
-12
lines changed

5 files changed

+11
-12
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1178,7 +1178,7 @@
11781178
<item name="dataset" xsi:type="string">default</item>
11791179
</field>
11801180
<field name="checkout_data" xsi:type="array">
1181-
<item name="dataset" xsi:type="string">configurable_default_1</item>
1181+
<item name="dataset" xsi:type="string">configurable_default_with_two_options</item>
11821182
</field>
11831183
<field name="category_ids" xsi:type="array">
11841184
<item name="dataset" xsi:type="string">default_subcategory</item>

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -467,7 +467,7 @@
467467
</field>
468468
</dataset>
469469

470-
<dataset name="configurable_default_1">
470+
<dataset name="configurable_default_with_two_options">
471471
<field name="options" xsi:type="array">
472472
<item name="configurable_options" xsi:type="array">
473473
<item name="0" xsi:type="array">

dev/tests/functional/tests/app/Magento/Reports/Test/Block/Adminhtml/Product/Sold/Grid.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ class Grid extends \Magento\Backend\Test\Block\Widget\Grid
4141
*/
4242
protected $productSku = './/*[contains(.,"%s")]/*[contains(@class,"col-sku")]';
4343

44-
4544
/**
4645
* Filter locator
4746
*

dev/tests/functional/tests/app/Magento/Reports/Test/Constraint/AssertOrderedProductReportForConfigurableProduct.php

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -28,21 +28,22 @@ public function processAssert(OrderedProductsReport $orderedProducts, OrderInjec
2828
{
2929
$products = $order->getEntityId()['products'];
3030
$simpleChildSku = $orderedProducts->getGridBlock()->getOrdersResultsforConfigurableProducts($order);
31-
$filters =[];
31+
$filters = [];
3232
foreach ($products as $product) {
3333
/** @var ConfigurableProduct $product */
3434
if ($product->hasData('configurable_attributes_data')) {
35-
$configurableAttributesData = $product->getConfigurableAttributesData();
36-
foreach ($configurableAttributesData['matrix'] as $variation) {
35+
$matrix = isset($product->getConfigurableAttributesData()['matrix']) ?
36+
$product->getConfigurableAttributesData()['matrix'] : [];
37+
foreach ($matrix as $variation) {
3738
$filters[] = $variation['sku'];
3839
}
3940
}
4041
}
41-
\PHPUnit_Framework_Assert::assertContains(
42-
$simpleChildSku[0],
43-
$filters,
44-
'Ordered simple product sku is not present in the Reports grid'
45-
);
42+
\PHPUnit_Framework_Assert::assertContains(
43+
$simpleChildSku[0],
44+
$filters,
45+
'Ordered simple product sku is not present in the Reports grid'
46+
);
4647
}
4748

4849
/**

dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/OrderedProductsReportEntityTest.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ class OrderedProductsReportEntityTest extends Injectable
2828
{
2929
/* tags */
3030
const MVP = 'no';
31-
const STABLE = 'no';
3231
/* end tags */
3332

3433
/**

0 commit comments

Comments
 (0)