Skip to content

Commit

Permalink
ENGCOM-7467: Fixes unstable email integration tests #27892
Browse files Browse the repository at this point in the history
  • Loading branch information
slavvka authored Apr 23, 2020
2 parents d4a9098 + e212405 commit 9ab62c2
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 9ab62c2

Please sign in to comment.