Skip to content

Replace Zend_Mail (ZF1) with Zend\Mail (ZF2) #8608

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 13 commits into from
Jul 12, 2017
6 changes: 0 additions & 6 deletions app/code/Magento/Newsletter/Model/Template.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,6 @@
*/
class Template extends \Magento\Email\Model\AbstractTemplate
{
/**
* Mail object
*
* @var \Zend_Mail
*/
protected $_mail;

/**
* Store manager to emulate design
Expand Down
1 change: 1 addition & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
"zendframework/zend-validator": "^2.6.0",
"zendframework/zend-crypt": "^2.6.0",
"zendframework/zend-console": "^2.6.0",
"zendframework/zend-mail": "^2.8.0",
"zendframework/zend-modulemanager": "^2.7",
"zendframework/zend-mvc": "~2.6.3",
"zendframework/zend-text": "^2.6.0",
Expand Down
163 changes: 137 additions & 26 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@

namespace Magento\Newsletter\Model;

use Magento\TestFramework\Mail\Template\TransportBuilderMock;

class SubscriberTest extends \PHPUnit_Framework_TestCase
{
/**
Expand All @@ -27,13 +29,14 @@ protected function setUp()
public function testEmailConfirmation()
{
$this->_model->subscribe('[email protected]');
/** @var TransportBuilderMock $transportBuilder */
$transportBuilder = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()
->get(\Magento\TestFramework\Mail\Template\TransportBuilderMock::class);
// confirmationCode 'ysayquyajua23iq29gxwu2eax2qb6gvy' is taken from fixture
$this->assertContains(
'/newsletter/subscriber/confirm/id/' . $this->_model->getSubscriberId()
. '/code/ysayquyajua23iq29gxwu2eax2qb6gvy',
$transportBuilder->getSentMessage()->getBodyHtml()->getRawContent()
$transportBuilder->getSentMessage()->getRawMessage()
);
$this->assertEquals(Subscriber::STATUS_NOT_ACTIVE, $this->_model->getSubscriberStatus());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ public function testSend($isCustomerIdUsed)
);
$this->assertContains(
'John Smith,',
$transportBuilder->getSentMessage()->getBodyHtml()->getRawContent()
$transportBuilder->getSentMessage()->getRawMessage()
);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public function testProcess()
);
$this->assertContains(
'John Smith,',
$transportBuilder->getSentMessage()->getBodyHtml()->getRawContent()
$transportBuilder->getSentMessage()->getRawMessage()
);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ public function testSendAction()
);

$actualResult = \Zend_Mime_Decode::decodeQuotedPrintable(
$transportBuilder->getSentMessage()->getBodyHtml()->getContent()
$transportBuilder->getSentMessage()->getRawMessage()
);

$this->assertStringMatchesFormat(
Expand Down
Loading