File tree Expand file tree Collapse file tree 2 files changed +18
-2
lines changed
dev/tests/functional/tests/app/Magento
CatalogImportExport/Test/Constraint
ImportExport/Test/Block/Adminhtml/Import/Edit Expand file tree Collapse file tree 2 files changed +18
-2
lines changed Original file line number Diff line number Diff line change @@ -145,7 +145,17 @@ private function getResultCsv($productSku)
145
145
*/
146
146
protected function getResultProductsData (array $ productsData )
147
147
{
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 ;
149
159
}
150
160
151
161
/**
@@ -158,7 +168,7 @@ private function deleteUnusedData(array $csvData)
158
168
{
159
169
$ data = [];
160
170
foreach ($ csvData as $ key => $ value ) {
161
- if (array_search ($ key , $ this ->neededKeys )) {
171
+ if (array_key_exists ($ key , array_flip ( $ this ->neededKeys )) !== false ) {
162
172
$ data [$ key ] = $ value ;
163
173
}
164
174
}
Original file line number Diff line number Diff line change @@ -23,6 +23,12 @@ class Form extends \Magento\Mtf\Block\Form
23
23
public function fill (FixtureInterface $ fixture , SimpleElement $ element = null )
24
24
{
25
25
$ 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
+
26
32
$ fields = isset ($ data ['fields ' ]) ? $ data ['fields ' ] : $ data ;
27
33
$ mapping = $ this ->dataMapping ($ fields );
28
34
$ this ->_fill ($ mapping , $ element );
You can’t perform that action at this time.
0 commit comments