-
Notifications
You must be signed in to change notification settings - Fork 9.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
MAGETWO-91701: Newsletter subscription is not correctly updated when …
…user is registered on 2 stores - Adding additional checking for guest customers
- Loading branch information
1 parent
e3a9ac2
commit 5da5e4e
Showing
2 changed files
with
4 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -63,14 +63,14 @@ public function testCustomerCreated() | |
->setFirstname('Firstname') | ||
->setLastname('Lastname') | ||
->setEmail('[email protected]'); | ||
$createdCustomer = $this->customerRepository->save( | ||
$this->customerRepository->save( | ||
$customerDataObject, | ||
$this->accountManagement->getPasswordHash('password') | ||
); | ||
|
||
$subscriber->loadByEmail('[email protected]'); | ||
$this->assertTrue($subscriber->isSubscribed()); | ||
$this->assertEquals((int)$createdCustomer->getId(), (int)$subscriber->getCustomerId()); | ||
$this->assertEquals(0, (int)$subscriber->getCustomerId()); | ||
} | ||
|
||
/** | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -40,15 +40,13 @@ public function testLoadByCustomerDataWithCustomerId() | |
* @magentoDataFixture Magento/Newsletter/_files/subscribers.php | ||
* @magentoDataFixture Magento/Customer/_files/two_customers.php | ||
*/ | ||
public function testLoadByCustomerDataWithoutCustomerId() | ||
public function testTryLoadByCustomerDataWithoutCustomerId() | ||
{ | ||
/** @var \Magento\Customer\Api\CustomerRepositoryInterface $customerRepository */ | ||
$customerRepository = Bootstrap::getObjectManager() | ||
->create(\Magento\Customer\Api\CustomerRepositoryInterface::class); | ||
$customerData = $customerRepository->getById(2); | ||
$result = $this->_resourceModel->loadByCustomerData($customerData); | ||
|
||
$this->assertEquals(0, $result['customer_id']); | ||
$this->assertEquals('[email protected]', $result['subscriber_email']); | ||
$this->assertEmpty($result); | ||
} | ||
} |