Skip to content

Commit cfc2658

Browse files
committed
MTA-576: Re-factor Test for Create Customer on Backend
- Added old data set
1 parent 52560b3 commit cfc2658

File tree

3 files changed

+41
-1
lines changed

3 files changed

+41
-1
lines changed

dev/tests/functional/tests/app/Magento/Customer/Test/Fixture/Customer.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
<attribute_code>address</attribute_code>
2828
<backend_type>virtual</backend_type>
2929
<source>Magento\Customer\Test\Fixture\Customer\Address</source>
30+
<group>addresses</group>
3031
</field>
3132
<field name="confirmation">
3233
<attribute_code>confirmation</attribute_code>

dev/tests/functional/tests/app/Magento/Customer/Test/Repository/Customer.xml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,5 +147,41 @@
147147
<item name="presets" xsi:type="string">address_US_1</item>
148148
</field>
149149
</dataset>
150+
151+
<dataset name="backend_retailer_customer">
152+
<field name="firstname" xsi:type="string">John</field>
153+
<field name="lastname" xsi:type="string">Doe%isolation%</field>
154+
<field name="group_id" xsi:type="array">
155+
<item name="dataSet" xsi:type="string">Retailer</item>
156+
</field>
157+
<field name="email" xsi:type="string">John.Doe%isolation%@example.com</field>
158+
<field name="password" xsi:type="string">123123q</field>
159+
<field name="password_confirmation" xsi:type="string">123123q</field>
160+
<field name="address" xsi:type="array">
161+
<item name="presets" xsi:type="string">address_US_1</item>
162+
</field>
163+
</dataset>
164+
165+
<dataset name="customer_US_1">
166+
<field name="firstname" xsi:type="string">John</field>
167+
<field name="lastname" xsi:type="string">Doe%isolation%</field>
168+
<field name="email" xsi:type="string">John.Doe%isolation%@example.com</field>
169+
<field name="password" xsi:type="string">123123q</field>
170+
<field name="password_confirmation" xsi:type="string">123123q</field>
171+
<field name="address" xsi:type="array">
172+
<item name="presets" xsi:type="string">address_US_1</item>
173+
</field>
174+
</dataset>
175+
176+
<dataset name="customer_UK_1">
177+
<field name="firstname" xsi:type="string">John</field>
178+
<field name="lastname" xsi:type="string">Doe%isolation%</field>
179+
<field name="email" xsi:type="string">John.Doe%isolation%@example.com</field>
180+
<field name="password" xsi:type="string">123123q</field>
181+
<field name="password_confirmation" xsi:type="string">123123q</field>
182+
<field name="address" xsi:type="array">
183+
<item name="presets" xsi:type="string">address_UK</item>
184+
</field>
185+
</dataset>
150186
</storage>
151187
</repository>

dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/ForgotPasswordOnFrontendTest.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,10 @@ class ForgotPasswordOnFrontendTest extends Functional
2020
public function testForgotPassword()
2121
{
2222
// Create Customer
23-
$customer = Factory::getFixtureFactory()->getMagentoCustomerCustomer(['dataSet' => 'customer_US_1']);
23+
$customer = ObjectManager::getInstance()->create(
24+
'Magento\Customer\Test\Fixture\Customer',
25+
['dataSet' => 'customer_US_1']
26+
);
2427
$customer->persist();
2528

2629
$customerAccountLoginPage = Factory::getPageFactory()->getCustomerAccountLogin();

0 commit comments

Comments
 (0)