Skip to content

Commit

Permalink
Merge pull request #1620 from magento-engcom/2.2-develop-prs
Browse files Browse the repository at this point in the history
Public Pull Requests

#11676 #7915: customer objects are equal to eachother after observing event customer_save_after_data_object by @RomaKis
#11677 [BACKPORT 2.2] [TASK] Moved Customer Groups Menu Item from Other sett… by @lewisvoncken

Fixed Public Issues

#7915 customer objects are equal to eachother after observing event customer_save_after_data_object
  • Loading branch information
Oleksii Korshenko authored Oct 25, 2017
2 parents b78dacf + 70425b3 commit 08f0056
Show file tree
Hide file tree
Showing 9 changed files with 14 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ public function save(\Magento\Customer\Api\Data\CustomerInterface $customer, $pa
$savedCustomer = $this->get($customer->getEmail(), $customer->getWebsiteId());
$this->eventManager->dispatch(
'customer_save_after_data_object',
['customer_data_object' => $savedCustomer, 'orig_customer_data_object' => $customer]
['customer_data_object' => $savedCustomer, 'orig_customer_data_object' => $prevCustomerData]
);
return $savedCustomer;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,8 @@ public function testSave()
'save',
]);

$origCustomer = $this->customer;

$this->customer->expects($this->atLeastOnce())
->method('__toArray')
->willReturn(['default_billing', 'default_shipping']);
Expand Down Expand Up @@ -417,7 +419,7 @@ public function testSave()
->method('dispatch')
->with(
'customer_save_after_data_object',
['customer_data_object' => $this->customer, 'orig_customer_data_object' => $customerAttributesMetaData]
['customer_data_object' => $this->customer, 'orig_customer_data_object' => $origCustomer]
);

$this->model->save($this->customer);
Expand Down Expand Up @@ -475,6 +477,8 @@ public function testSaveWithPasswordHash()
]
);

$origCustomer = $this->customer;

$this->customer->expects($this->atLeastOnce())
->method('__toArray')
->willReturn(['default_billing', 'default_shipping']);
Expand Down Expand Up @@ -642,7 +646,7 @@ public function testSaveWithPasswordHash()
->method('dispatch')
->with(
'customer_save_after_data_object',
['customer_data_object' => $this->customer, 'orig_customer_data_object' => $customerAttributesMetaData]
['customer_data_object' => $this->customer, 'orig_customer_data_object' => $origCustomer]
);

$this->model->save($this->customer, $passwordHash);
Expand Down
2 changes: 1 addition & 1 deletion app/code/Magento/Customer/etc/adminhtml/menu.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@
<add id="Magento_Customer::customer" title="Customers" translate="title" module="Magento_Customer" sortOrder="30" resource="Magento_Customer::customer"/>
<add id="Magento_Customer::customer_manage" title="All Customers" translate="title" module="Magento_Customer" sortOrder="10" parent="Magento_Customer::customer" action="customer/index/" resource="Magento_Customer::manage"/>
<add id="Magento_Customer::customer_online" title="Now Online" translate="title" module="Magento_Customer" sortOrder="30" parent="Magento_Customer::customer" action="customer/online/" resource="Magento_Customer::online"/>
<add id="Magento_Customer::customer_group" title="Customer Groups" translate="title" module="Magento_Customer" sortOrder="50" parent="Magento_Backend::other_settings" action="customer/group" resource="Magento_Customer::group"/>
<add id="Magento_Customer::customer_group" title="Customer Groups" translate="title" module="Magento_Customer" sortOrder="50" parent="Magento_Customer::customer" action="customer/group" resource="Magento_Customer::group"/>
</menu>
</config>
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
*
* Test Flow:
* 1.Log in to backend as admin user.
* 2.Navigate to Stores>Other Settings>Customer Groups.
* 2.Navigate to Customers > Customer Groups.
* 3.Start to create new Customer Group.
* 4.Fill in all data according to data set.
* 5.Click "Save Customer Group" button.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
* 2. Customer is created and assigned to this group.
* Steps:
* 1. Log in to backend as admin user.
* 2. Navigate to Stores > Other Settings > Customer Groups.
* 2. Navigate to Customers > Customer Groups.
* 3. Click on Customer Group from grid.
* 4. Click on Delete "Customer Group".
* 5. Confirm in pop-up.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
/**
* Steps:
* 1. Login to backend as admin user.
* 2. Navigate to Stores > Other Settings > Customer Groups.
* 2. Navigate to Customers > Customer Groups.
* 3. Select system Customer Group specified in data set from grid.
* 4. Perform all assertions.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<constraint name="Magento\Backend\Test\Constraint\AssertBackendPageIsAvailable"/>
</variation>
<variation name="NavigateMenuTest24">
<data name="menuItem" xsi:type="string">Stores > Customer Groups</data>
<data name="menuItem" xsi:type="string">Customers > Customer Groups</data>
<data name="pageTitle" xsi:type="string">Customer Groups</data>
<constraint name="Magento\Backend\Test\Constraint\AssertBackendPageIsAvailable"/>
</variation>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
* 1. Customer Group is created
* Steps:
* 1. Log in to backend as admin user
* 2. Navigate to Stores > Other Settings > Customer Groups
* 2. Navigate to Customers > Customer Groups
* 3. Click on Customer Group from grid
* 4. Update data according to data set
* 5. Click "Save Customer Group" button
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
/**
* Steps:
* 1. Login to backend as admin user.
* 2. Navigate to Stores > Other Settings > Customer Groups.
* 2. Navigate to Customers > Customer Groups.
* 3. Select system Customer Group specified in data set from grid.
* 4. Perform all assertions.
*
Expand Down

0 comments on commit 08f0056

Please sign in to comment.