Skip to content

Commit 0ae6c38

Browse files
MTO-127: [Test] Import Advanced Pricing
- Stabilization
1 parent ef8db47 commit 0ae6c38

File tree

2 files changed

+12
-5
lines changed

2 files changed

+12
-5
lines changed

dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertAdvancedPriceAbsentOnProductForm.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,13 @@ class AssertAdvancedPriceAbsentOnProductForm extends AbstractConstraint
1818
/**
1919
* Assert advanced price is absent on product page in form.
2020
*
21-
* @param FixtureInterface[] $products
21+
* @param FixtureInterface[] $entities
2222
* @param CatalogProductEdit $productPage
2323
* @return void
2424
*/
25-
public function processAssert(array $products, CatalogProductEdit $productPage)
25+
public function processAssert(array $entities, CatalogProductEdit $productPage)
2626
{
27-
foreach ($products as $product) {
27+
foreach ($entities as $product) {
2828
$productPage->open(['id' => $product->getData('id')]);
2929
/** @var AdvancedPricing $advancedPricing */
3030
$advancedPricing = $productPage->getProductForm()

dev/tests/functional/tests/app/Magento/ImportExport/Test/Fixture/Import/File.php

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,12 @@ private function preparePlaceHolders()
213213
if (isset($entityData[$index])) {
214214
$placeholders['entity_' . $key][$tierKey]["%{$index}%"] = $entityData[$index];
215215
}
216-
$placeholders['entity_' . $key][$tierKey][$entityData['code']] = $entityData[$entityData['code']];
216+
if (isset($entityData['code'])) {
217+
$placeholders['entity_' . $key][$tierKey][$entityData['code']]
218+
= isset($entityData[$entityData['code']])
219+
? $entityData[$entityData['code']]
220+
: 'Main Website';
221+
}
217222
}
218223
}
219224
$key++;
@@ -237,7 +242,9 @@ public function prepareEntityData(FixtureInterface $entity)
237242
$websites = $entity->getDataFieldConfig('website_ids')['source']->getWebsites();
238243
foreach ($websites as $website) {
239244
if ($website->getCode() === 'base') {
240-
$currency = $this->value['template']['mainWebsiteCurrency'];
245+
$currency = isset($this->value['template']['mainWebsiteCurrency'])
246+
? $this->value['template']['websiteCurrency']
247+
: '[USD]';
241248
$this->mainWebsiteMapping['base'] = $website->getName() . "[{$currency}]";
242249
break;
243250
}

0 commit comments

Comments
 (0)