Skip to content

Commit a96bd61

Browse files
author
Yaroslav Onischenko
committed
MAGETWO-52512: Newsletter subscription is not subscribing when Need to confirm is set to yes
1 parent bd6d108 commit a96bd61

File tree

1 file changed

+10
-11
lines changed
  • dev/tests/integration/testsuite/Magento/Newsletter/Model/ResourceModel/Subscriber

1 file changed

+10
-11
lines changed

dev/tests/integration/testsuite/Magento/Newsletter/Model/ResourceModel/Subscriber/CollectionTest.php

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -30,16 +30,15 @@ public function testShowCustomerInfo()
3030
$subscribers = $this->_collectionModel->getItems();
3131
$this->assertCount(3, $subscribers);
3232

33-
$subscriber = array_shift($subscribers);
34-
$this->assertEquals('John', $subscriber->getFirstname(), $subscriber->getSubscriberEmail());
35-
$this->assertEquals('Smith', $subscriber->getLastname(), $subscriber->getSubscriberEmail());
36-
37-
$subscriber = array_shift($subscribers);
38-
$this->assertEquals('John', $subscriber->getFirstname(), $subscriber->getSubscriberEmail());
39-
$this->assertEquals('Smith', $subscriber->getLastname(), $subscriber->getSubscriberEmail());
40-
41-
$subscriber = array_shift($subscribers);
42-
$this->assertNull($subscriber->getFirstname(), $subscriber->getSubscriberEmail());
43-
$this->assertNull($subscriber->getLastname(), $subscriber->getSubscriberEmail());
33+
while ($subscribers) {
34+
$subscriber = array_shift($subscribers);
35+
if ($subscriber->getCustomerId()) {
36+
$this->assertEquals('John', $subscriber->getFirstname(), $subscriber->getSubscriberEmail());
37+
$this->assertEquals('Smith', $subscriber->getLastname(), $subscriber->getSubscriberEmail());
38+
} else {
39+
$this->assertNull($subscriber->getFirstname(), $subscriber->getSubscriberEmail());
40+
$this->assertNull($subscriber->getLastname(), $subscriber->getSubscriberEmail());
41+
}
42+
}
4443
}
4544
}

0 commit comments

Comments
 (0)