Skip to content

Commit 0c0fcbf

Browse files
committed
#7915: customer objects are equal to eachother after observing event customer_save_after_data_object
1 parent d22516d commit 0c0fcbf

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

app/code/Magento/Customer/Test/Unit/Model/ResourceModel/CustomerRepositoryTest.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -230,6 +230,8 @@ public function testSave()
230230
'save',
231231
]);
232232

233+
$origCustomer = $this->customer;
234+
233235
$this->customer->expects($this->atLeastOnce())
234236
->method('__toArray')
235237
->willReturn(['default_billing', 'default_shipping']);
@@ -406,7 +408,7 @@ public function testSave()
406408
->method('dispatch')
407409
->with(
408410
'customer_save_after_data_object',
409-
['customer_data_object' => $this->customer, 'orig_customer_data_object' => $customerAttributesMetaData]
411+
['customer_data_object' => $this->customer, 'orig_customer_data_object' => $origCustomer]
410412
);
411413

412414
$this->model->save($this->customer);
@@ -464,6 +466,8 @@ public function testSaveWithPasswordHash()
464466
]
465467
);
466468

469+
$origCustomer = $this->customer;
470+
467471
$this->customer->expects($this->atLeastOnce())
468472
->method('__toArray')
469473
->willReturn(['default_billing', 'default_shipping']);
@@ -631,7 +635,7 @@ public function testSaveWithPasswordHash()
631635
->method('dispatch')
632636
->with(
633637
'customer_save_after_data_object',
634-
['customer_data_object' => $this->customer, 'orig_customer_data_object' => $customerAttributesMetaData]
638+
['customer_data_object' => $this->customer, 'orig_customer_data_object' => $origCustomer]
635639
);
636640

637641
$this->model->save($this->customer, $passwordHash);

0 commit comments

Comments
 (0)