Skip to content

Commit 9e726c3

Browse files
Merge pull request #49 from magento-epam/MAGETWO-91701-V2
MAGETWO-91701: Newsletter subscription is not correctly updated when …
2 parents a12c031 + 5da5e4e commit 9e726c3

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

dev/tests/integration/testsuite/Magento/Newsletter/Model/Plugin/PluginTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,14 +63,14 @@ public function testCustomerCreated()
6363
->setFirstname('Firstname')
6464
->setLastname('Lastname')
6565
->setEmail('customer_two@example.com');
66-
$createdCustomer = $this->customerRepository->save(
66+
$this->customerRepository->save(
6767
$customerDataObject,
6868
$this->accountManagement->getPasswordHash('password')
6969
);
7070

7171
$subscriber->loadByEmail('customer_two@example.com');
7272
$this->assertTrue($subscriber->isSubscribed());
73-
$this->assertEquals((int)$createdCustomer->getId(), (int)$subscriber->getCustomerId());
73+
$this->assertEquals(0, (int)$subscriber->getCustomerId());
7474
}
7575

7676
/**

dev/tests/integration/testsuite/Magento/Newsletter/Model/ResourceModel/SubscriberTest.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,15 +40,13 @@ public function testLoadByCustomerDataWithCustomerId()
4040
* @magentoDataFixture Magento/Newsletter/_files/subscribers.php
4141
* @magentoDataFixture Magento/Customer/_files/two_customers.php
4242
*/
43-
public function testLoadByCustomerDataWithoutCustomerId()
43+
public function testTryLoadByCustomerDataWithoutCustomerId()
4444
{
4545
/** @var \Magento\Customer\Api\CustomerRepositoryInterface $customerRepository */
4646
$customerRepository = Bootstrap::getObjectManager()
4747
->create(\Magento\Customer\Api\CustomerRepositoryInterface::class);
4848
$customerData = $customerRepository->getById(2);
4949
$result = $this->_resourceModel->loadByCustomerData($customerData);
50-
51-
$this->assertEquals(0, $result['customer_id']);
52-
$this->assertEquals('customer_two@example.com', $result['subscriber_email']);
50+
$this->assertEmpty($result);
5351
}
5452
}

0 commit comments

Comments
 (0)