Skip to content

Commit 5be6aa5

Browse files
author
Stanislav Idolov
committed
MAGETWO-59626: Error saving configurable product after disabling child products
1 parent 8fe4030 commit 5be6aa5

File tree

2 files changed

+46
-0
lines changed

2 files changed

+46
-0
lines changed
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
<?php
2+
/**
3+
* Copyright © 2016 Magento. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
7+
namespace Magento\Catalog\Test\Constraint;
8+
9+
use Magento\Mtf\Fixture\InjectableFixture;
10+
use Magento\Mtf\Constraint\AbstractConstraint;
11+
use Magento\Catalog\Test\Page\Adminhtml\CatalogProductIndex;
12+
13+
class AssertProductHasImageInGrid extends AbstractConstraint
14+
{
15+
/**
16+
* Assert that product image is present in grid.
17+
*
18+
* @param CatalogProductIndex $productGrid
19+
* @param InjectableFixture $product
20+
* @return void
21+
*/
22+
public function processAssert(
23+
CatalogProductIndex $productGrid,
24+
InjectableFixture $product
25+
) {
26+
$filter = ['sku' => $product->getSku()];
27+
$productGrid->open();
28+
$productGrid->getProductGrid()->search($filter);
29+
$src = $productGrid->getProductGrid()->getBaseImageSource();
30+
\PHPUnit_Framework_Assert::assertTrue(
31+
strpos($src, '/placeholder/') === false,
32+
'Product image is not present in product grid when it should be'
33+
);
34+
}
35+
36+
/**
37+
* Returns a string representation of the object.
38+
*
39+
* @return string
40+
*/
41+
public function toString()
42+
{
43+
return 'Product image is displayed in product grid.';
44+
}
45+
}

dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/CreateSimpleProductEntityTest.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -520,6 +520,7 @@
520520
<data name="tag" xsi:type="string">severity:S1</data>
521521
<data name="product/data/quantity_and_stock_status/qty" xsi:type="string">100</data>
522522
<constraint name="Magento\Catalog\Test\Constraint\AssertProductSaveMessage" />
523+
<constraint name="Magento\Catalog\Test\Constraint\AssertProductHasImageInGrid" />
523524
<constraint name="Magento\Catalog\Test\Constraint\AssertCanSaveProduct" />
524525
</variation>
525526
</testCase>

0 commit comments

Comments
 (0)