File tree Expand file tree Collapse file tree 2 files changed +7
-8
lines changed
dev/tests/api-functional/testsuite/Magento/Customer/Api Expand file tree Collapse file tree 2 files changed +7
-8
lines changed Original file line number Diff line number Diff line change 16
16
/**
17
17
* Class AccountManagementMeTest
18
18
*
19
+ * Tests involving the customer modifying their user information via web API.
20
+ *
19
21
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
20
22
* @magentoApiDataFixture Magento/Customer/_files/customer.php
21
23
* @magentoApiDataFixture Magento/Customer/_files/customer_two_addresses.php
@@ -144,13 +146,14 @@ public function testUpdateCustomer()
144
146
{
145
147
$ customerData = $ this ->_getCustomerData ($ this ->customerData [CustomerInterface::ID ]);
146
148
$ lastName = $ customerData ->getLastname ();
147
-
149
+ $ groupID = $ customerData -> getGroupId ();
148
150
$ updatedCustomerData = $ this ->dataObjectProcessor ->buildOutputDataArray (
149
151
$ customerData ,
150
152
\Magento \Customer \Api \Data \CustomerInterface::class
151
153
);
152
154
$ updatedCustomerData [CustomerInterface::LASTNAME ] = $ lastName . 'Updated ' ;
153
155
$ updatedCustomerData [CustomerInterface::ID ] = 25 ;
156
+ $ updatedCustomerData [CustomerInterface::GROUP_ID ] = $ groupID . 1 ;
154
157
155
158
$ serviceInfo = [
156
159
'rest ' => [
@@ -172,6 +175,7 @@ public function testUpdateCustomer()
172
175
173
176
$ customerData = $ this ->_getCustomerData ($ this ->customerData [CustomerInterface::ID ]);
174
177
$ this ->assertEquals ($ lastName . "Updated " , $ customerData ->getLastname ());
178
+ $ this ->assertEquals ($ groupID , $ customerData ->getGroupId ());
175
179
}
176
180
177
181
public function testGetCustomerData ()
Original file line number Diff line number Diff line change @@ -268,7 +268,6 @@ public function testUpdateCustomer()
268
268
$ customerData = $ this ->_createCustomer ();
269
269
$ existingCustomerDataObject = $ this ->_getCustomerData ($ customerData [Customer::ID ]);
270
270
$ lastName = $ existingCustomerDataObject ->getLastname ();
271
- $ expectedGroupID = $ existingCustomerDataObject ->getGroupId ();
272
271
$ customerData [Customer::LASTNAME ] = $ lastName . 'Updated ' ;
273
272
$ newCustomerDataObject = $ this ->customerDataFactory ->create ();
274
273
$ this ->dataObjectHelper ->populateWithArray (
@@ -297,12 +296,8 @@ public function testUpdateCustomer()
297
296
$ this ->assertTrue ($ response !== null );
298
297
299
298
//Verify if the customer is updated
300
- $ updatedCustomerDataObject = $ this ->_getCustomerData ($ customerData [Customer::ID ]);
301
- $ this ->assertEquals (
302
- $ updatedCustomerDataObject ->getGroupId (),
303
- $ expectedGroupID
304
- );
305
- $ this ->assertEquals ($ lastName . "Updated " , $ updatedCustomerDataObject ->getLastname ());
299
+ $ existingCustomerDataObject = $ this ->_getCustomerData ($ customerData [Customer::ID ]);
300
+ $ this ->assertEquals ($ lastName . "Updated " , $ existingCustomerDataObject ->getLastname ());
306
301
}
307
302
308
303
/**
You can’t perform that action at this time.
0 commit comments