Skip to content

Commit fadf793

Browse files
MTO-104: [Test] Export Customer Addresses
- Tests fixed.
1 parent 808f0e0 commit fadf793

File tree

4 files changed

+23
-15
lines changed

4 files changed

+23
-15
lines changed

dev/tests/functional/tests/app/Magento/Captcha/Test/TestCase/CaptchaEditCustomerTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,7 @@ public function test(
121121

122122
/** @var Customer $initCustomer */
123123
$initCustomer = $this->fixtureFactory->createByCode('customer', ['data' => $data]);
124+
//Add + 1 to attempts to get over maximum attempts count.
124125
$this->customerEdit($initCustomer, $attempts + 1);
125126
}
126127

dev/tests/functional/tests/app/Magento/CustomerImportExport/Test/Constraint/AssertImportCustomerAddresses.php

Lines changed: 19 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -22,15 +22,24 @@ class AssertImportCustomerAddresses extends AbstractConstraint
2222
* @var array
2323
*/
2424
private $mappingKeys = [
25-
'firstname' => 'firstname',
26-
'lastname' => 'lastname',
27-
'postcode' => 'postcode',
28-
'region' => 'region_id',
29-
'city' => 'city',
30-
'company' => 'company',
31-
'country_id' => 'country_id',
32-
'street' => 'street',
33-
'telephone' => 'telephone',
25+
'region' => 'region_id'
26+
];
27+
28+
/**
29+
* Imported fields keys.
30+
*
31+
* @var array
32+
*/
33+
private $importedFieldsKeys = [
34+
'firstname',
35+
'lastname',
36+
'postcode',
37+
'region_id',
38+
'city',
39+
'company',
40+
'country_id',
41+
'street',
42+
'telephone'
3443
];
3544

3645
/**
@@ -156,7 +165,7 @@ private function getResultCsv()
156165
*/
157166
private function deleteWasteData(array $csvData)
158167
{
159-
$necessaryData = array_flip($this->mappingKeys);
168+
$necessaryData = array_flip($this->importedFieldsKeys);
160169

161170
return array_intersect_key($csvData, $necessaryData);
162171
}

dev/tests/functional/tests/app/Magento/CustomerImportExport/Test/TestCase/ImportCustomerAddressTest.xml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,7 @@
2020
<item name="0" xsi:type="string">customer::johndoe_with_addresses</item>
2121
</item>
2222
<item name="template" xsi:type="array">
23-
<item name="filename"
24-
xsi:type="string">Magento/CustomerImportExport/Test/_files/template/address/customer_addresses_variation_1</item>
23+
<item name="filename" xsi:type="string">Magento/CustomerImportExport/Test/_files/template/address/customer_addresses_variation_1</item>
2524
<item name="count" xsi:type="number">1</item>
2625
</item>
2726
</item>
@@ -43,8 +42,7 @@
4342
<item name="1" xsi:type="string">customer::default</item>
4443
</item>
4544
<item name="template" xsi:type="array">
46-
<item name="filename"
47-
xsi:type="string">Magento/CustomerImportExport/Test/_files/template/address/customer_addresses_variation_2</item>
45+
<item name="filename" xsi:type="string">Magento/CustomerImportExport/Test/_files/template/address/customer_addresses_variation_2</item>
4846
<item name="count" xsi:type="number">2</item>
4947
</item>
5048
</item>

dev/tests/functional/tests/app/Magento/ImportExport/Test/Block/Adminhtml/Import/Edit/CustomForm.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,6 @@
3333
<import_file>
3434
<input>upload</input>
3535
</import_file>
36-
<import_images_file_dir/>
36+
<import_images_file_dir />
3737
</fields>
3838
</mapping>

0 commit comments

Comments
 (0)