Skip to content

Commit 738fef5

Browse files
MTO-128: [Test] Export Products
- Stabilization.
1 parent 199f856 commit 738fef5

File tree

2 files changed

+18
-2
lines changed

2 files changed

+18
-2
lines changed

dev/tests/functional/tests/app/Magento/CatalogImportExport/Test/Constraint/AssertImportProduct.php

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,17 @@ private function getResultCsv($productSku)
145145
*/
146146
protected function getResultProductsData(array $productsData)
147147
{
148-
return array_intersect_key($productsData, array_flip($this->neededKeys));
148+
$resultProductsData = [];
149+
array_walk_recursive(
150+
$productsData,
151+
function ($value, $key) use (&$resultProductsData) {
152+
if (array_key_exists($key, array_flip($this->neededKeys)) !== false) {
153+
$resultProductsData[$key] = $value;
154+
}
155+
}
156+
);
157+
158+
return $resultProductsData;
149159
}
150160

151161
/**
@@ -158,7 +168,7 @@ private function deleteUnusedData(array $csvData)
158168
{
159169
$data = [];
160170
foreach ($csvData as $key => $value) {
161-
if (array_search($key, $this->neededKeys)) {
171+
if (array_key_exists($key, array_flip($this->neededKeys)) !== false) {
162172
$data[$key] = $value;
163173
}
164174
}

dev/tests/functional/tests/app/Magento/ImportExport/Test/Block/Adminhtml/Import/Edit/Form.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,12 @@ class Form extends \Magento\Mtf\Block\Form
2323
public function fill(FixtureInterface $fixture, SimpleElement $element = null)
2424
{
2525
$data = $fixture->getData();
26+
27+
//Move file to the end of the list in order to fill form with attached file correctly.
28+
$importFile = $data['import_file'];
29+
unset($data['import_file']);
30+
$data['import_file'] = $importFile;
31+
2632
$fields = isset($data['fields']) ? $data['fields'] : $data;
2733
$mapping = $this->dataMapping($fields);
2834
$this->_fill($mapping, $element);

0 commit comments

Comments
 (0)