Skip to content

Commit 4d128eb

Browse files
author
Olexandr Lysenko
committed
MAGETWO-58896: Product Fields Auto-Generation does not work as expected
1 parent 71f0f3c commit 4d128eb

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/CreateSimpleProductEntitybyAttributeMaskSkuTest.php

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,12 +38,12 @@ class CreateSimpleProductEntityByAttributeMaskSkuTest extends Injectable
3838
* @var bool
3939
*/
4040
private $flushCache;
41+
4142
/**
4243
* @var \Magento\Mtf\Fixture\FixtureFactory
4344
*/
4445
private $fixtureFactory;
4546

46-
4747
/**
4848
* Run create product simple entity by attribute mask SKU test.
4949
*
@@ -88,7 +88,6 @@ public function testCreate(
8888
return ['product' => $productSimple];
8989
}
9090

91-
9291
/**
9392
* Obtains product sku based on attributes define in Stores > Configuration->Catalog > Catalog > Mask for SKU
9493
*
@@ -108,14 +107,14 @@ private function prepareSkuByMask(CatalogProductSimple $product)
108107
$attributesInPattern = [];
109108
$count = preg_match_all('/{{(\w+)}}/', $skuMask, $matches);
110109
if ($count > 0 && is_array($matches[0])) {
111-
foreach($matches[1] as $attributeName) {
110+
foreach ($matches[1] as $attributeName) {
112111
if (array_key_exists($attributeName, $productData)) {
113112
$attributesInPattern[$attributeName] = $productData[$attributeName];
114113
}
115114
}
116115
}
117-
foreach($attributesInPattern as $attributeName => $attributeValue) {
118-
$skuMask = str_replace('{{'. $attributeName .'}}', $attributeValue, $skuMask);
116+
foreach ($attributesInPattern as $attributeName => $attributeValue) {
117+
$skuMask = str_replace('{{' . $attributeName . '}}', $attributeValue, $skuMask);
119118
}
120119
return $skuMask;
121120
}

0 commit comments

Comments
 (0)