Skip to content

Commit 5c1b8d4

Browse files
committed
MAGETWO-51951: SQL Error when cloning product with custom option with CatalogStaging enabled
- fix test
1 parent 15a8c1a commit 5c1b8d4

File tree

1 file changed

+8
-16
lines changed
  • dev/tests/integration/testsuite/Magento/Catalog/Model/Product/Attribute/Backend

1 file changed

+8
-16
lines changed

dev/tests/integration/testsuite/Magento/Catalog/Model/Product/Attribute/Backend/SkuTest.php

Lines changed: 8 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -38,13 +38,18 @@ public function testGenerateUniqueSkuNotExistingProduct($product)
3838
}
3939

4040
/**
41-
* @param $product \Magento\Catalog\Model\Product
42-
* @dataProvider uniqueLongSkuDataProvider
41+
* @magentoDataFixture Magento/Catalog/_files/product_simple.php
4342
* @magentoAppArea adminhtml
4443
* @magentoDbIsolation enabled
4544
*/
46-
public function testGenerateUniqueLongSku($product)
45+
public function testGenerateUniqueLongSku()
4746
{
47+
$repository = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create(
48+
'Magento\Catalog\Model\ProductRepository'
49+
);
50+
$product = $repository->get('simple');
51+
$product->setSku('0123456789012345678901234567890123456789012345678901234567890123');
52+
4853
/** @var \Magento\Catalog\Model\Product\Copier $copier */
4954
$copier = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get(
5055
'Magento\Catalog\Model\Product\Copier'
@@ -66,19 +71,6 @@ public function uniqueSkuDataProvider()
6671
return [[$product]];
6772
}
6873

69-
/**
70-
* Returns simple product
71-
*
72-
* @return array
73-
*/
74-
public function uniqueLongSkuDataProvider()
75-
{
76-
$product = $this->_getProduct();
77-
$product->setSku('0123456789012345678901234567890123456789012345678901234567890123');
78-
//strlen === 64
79-
return [[$product]];
80-
}
81-
8274
/**
8375
* Get product form data provider
8476
*

0 commit comments

Comments
 (0)