From 01eca72fc4a7f474efefc399a252b0207f5a2a1c Mon Sep 17 00:00:00 2001
From: Stanislav Idolov <sidolov@magento.com>
Date: Fri, 4 Nov 2016 12:29:13 +0200
Subject: [PATCH] MAGETWO-59626: Error saving configurable product after
 disabling child products

---
 .../Test/Block/Adminhtml/Product/Edit/Section/BlockGallery.php | 2 +-
 .../Magento/Catalog/Test/Constraint/AssertProductCanUpdate.php | 1 +
 .../tests/app/Magento/Catalog/Test/Fixture/Product/Image.php   | 1 +
 .../Test/TestCase/Product/CreateSimpleProductEntityTest.xml    | 3 ++-
 4 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/Edit/Section/BlockGallery.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/Edit/Section/BlockGallery.php
index 53f1f12ece6..bc1a0ebc4ce 100644
--- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/Edit/Section/BlockGallery.php
+++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/Edit/Section/BlockGallery.php
@@ -23,7 +23,7 @@ class BlockGallery extends Section
     public function setFieldsData(array $data, SimpleElement $element = null)
     {
         if (isset($data['image'])) {
-            foreach ($data['image']['value'] as $key => $imageData) {
+            foreach ($data['image']['value'] as $imageData) {
                 $uploadElement = $this->_rootElement->find('[name="image"]', Locator::SELECTOR_CSS, 'upload');
                 $uploadElement->setValue($imageData['file']);
                 $this->waitForElementNotVisible('.image.image-placeholder .file-row');
diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductCanUpdate.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductCanUpdate.php
index f126fef2a2d..24f1f9d7714 100644
--- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductCanUpdate.php
+++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductCanUpdate.php
@@ -17,6 +17,7 @@ class AssertProductCanUpdate extends \Magento\Mtf\Constraint\AbstractConstraint
      * @param \Magento\Mtf\Fixture\FixtureInterface $product
      * @param \Magento\Catalog\Test\Page\Adminhtml\CatalogProductEdit $catalogProductEdit
      * @param \Magento\Catalog\Test\Page\Adminhtml\CatalogProductIndex $catalogProductIndex
+     * @return void
      */
     public function processAssert(
         \Magento\Mtf\Fixture\FixtureInterface $product,
diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Fixture/Product/Image.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Fixture/Product/Image.php
index 60ad65971ff..0136c3431fe 100644
--- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Fixture/Product/Image.php
+++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Fixture/Product/Image.php
@@ -19,6 +19,7 @@ class Image extends DataSource
      * @param FixtureFactory $fixtureFactory
      * @param array $params
      * @param array $data
+     * @SuppressWarnings(PHPMD.UnusedFormalParameter)
      */
     public function __construct(FixtureFactory $fixtureFactory, array $params, $data = [])
     {
diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/CreateSimpleProductEntityTest.xml b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/CreateSimpleProductEntityTest.xml
index f414f2d9b8c..5e0a61a9c04 100644
--- a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/CreateSimpleProductEntityTest.xml
+++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/CreateSimpleProductEntityTest.xml
@@ -501,7 +501,7 @@
             <constraint name="Magento\Catalog\Test\Constraint\AssertProductInCart" />
         </variation>
         <variation name="CreateSimpleProductEntityWithImageTestVariation1">
-            <data name="description" xsi:type="string">Create product with image</data>
+            <data name="description" xsi:type="string">Create product with image and try to save it again</data>
             <data name="product/data/image/0/file" xsi:type="string">Magento/Catalog/Test/_files/test1.png</data>
             <data name="product/data/image/1/file" xsi:type="string">Magento/Catalog/Test/_files/test2.png</data>
             <data name="product/data/url_key" xsi:type="string">simple-product-%isolation%</data>
@@ -509,6 +509,7 @@
             <data name="product/data/sku" xsi:type="string">simple_sku_%isolation%</data>
             <data name="product/data/price/value" xsi:type="string">10</data>
             <data name="product/data/weight" xsi:type="string">50</data>
+            <data name="tag" xsi:type="string">severity:S1</data>
             <data name="product/data/quantity_and_stock_status/qty" xsi:type="string">100</data>
             <constraint name="Magento\Catalog\Test\Constraint\AssertProductSaveMessage" />
             <constraint name="Magento\Catalog\Test\Constraint\AssertProductCanUpdate" />
-- 
GitLab