Skip to content

Commit

Permalink
ENGCOM-7467: Fixes unstable email integration tests #27892
Browse files Browse the repository at this point in the history
 - Merge Pull Request #27892 from hostep/magento2:fix-unstable-email-tests-part2
 - Merged commits:
   1. 3ec905f
  • Loading branch information
magento-engcom-team committed Apr 23, 2020
2 parents d4a9098 + 3ec905f commit e212405
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -89,15 +89,15 @@ public function testUnsubscribeSubscribe(): void
$this->assertEquals($subscriber, $subscriber->unsubscribe());
$this->assertContains(
'You have been unsubscribed from the newsletter.',
$this->transportBuilder->getSentMessage()->getRawMessage()
$this->transportBuilder->getSentMessage()->getBody()->getParts()[0]->getRawContent()
);
$this->assertEquals(Subscriber::STATUS_UNSUBSCRIBED, $subscriber->getSubscriberStatus());
// Subscribe and verify
$this->assertEquals(Subscriber::STATUS_SUBSCRIBED, $subscriber->subscribe('[email protected]'));
$this->assertEquals(Subscriber::STATUS_SUBSCRIBED, $subscriber->getSubscriberStatus());
$this->assertContains(
'You have been successfully subscribed to our newsletter.',
$this->transportBuilder->getSentMessage()->getRawMessage()
$this->transportBuilder->getSentMessage()->getBody()->getParts()[0]->getRawContent()
);
}

Expand All @@ -116,14 +116,14 @@ public function testUnsubscribeSubscribeByCustomerId(): void
$this->assertEquals(Subscriber::STATUS_UNSUBSCRIBED, $subscriber->getSubscriberStatus());
$this->assertContains(
'You have been unsubscribed from the newsletter.',
$this->transportBuilder->getSentMessage()->getRawMessage()
$this->transportBuilder->getSentMessage()->getBody()->getParts()[0]->getRawContent()
);
// Subscribe and verify
$this->assertSame($subscriber, $subscriber->subscribeCustomerById(1));
$this->assertEquals(Subscriber::STATUS_SUBSCRIBED, $subscriber->getSubscriberStatus());
$this->assertContains(
'You have been successfully subscribed to our newsletter.',
$this->transportBuilder->getSentMessage()->getRawMessage()
$this->transportBuilder->getSentMessage()->getBody()->getParts()[0]->getRawContent()
);
}

Expand All @@ -143,7 +143,7 @@ public function testConfirm(): void
$subscriber->confirm($subscriber->getSubscriberConfirmCode());
$this->assertContains(
'You have been successfully subscribed to our newsletter.',
$this->transportBuilder->getSentMessage()->getRawMessage()
$this->transportBuilder->getSentMessage()->getBody()->getParts()[0]->getRawContent()
);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,8 @@ public function testSend($isCustomerIdUsed)
$this->_emailModel->send();

$this->assertContains(
'Smith,',
$this->transportBuilder->getSentMessage()->getRawMessage()
'John Smith,',
$this->transportBuilder->getSentMessage()->getBody()->getParts()[0]->getRawContent()
);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,8 @@ public function testProcess()
{
$this->observer->process();
$this->assertContains(
'ohn Smith,',
$this->transportBuilder->getSentMessage()->getRawMessage()
'John Smith,',
$this->transportBuilder->getSentMessage()->getBody()->getParts()[0]->getRawContent()
);
}

Expand Down

0 comments on commit e212405

Please sign in to comment.