Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#7915: customer objects are equal to eachother after observing event customer_save_after_data_object #11649

Merged
merged 2 commits into from
Oct 24, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,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 @@ -230,6 +230,8 @@ public function testSave()
'save',
]);

$origCustomer = $this->customer;

$this->customer->expects($this->atLeastOnce())
->method('__toArray')
->willReturn(['default_billing', 'default_shipping']);
Expand Down Expand Up @@ -406,7 +408,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 @@ -464,6 +466,8 @@ public function testSaveWithPasswordHash()
]
);

$origCustomer = $this->customer;

$this->customer->expects($this->atLeastOnce())
->method('__toArray')
->willReturn(['default_billing', 'default_shipping']);
Expand Down Expand Up @@ -631,7 +635,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