Файл: gapps/vendor/swiftmailer/swiftmailer/tests/acceptance/Swift/MessageAcceptanceTest.php
Строк: 78
<?php
require_once 'swift_required.php';
require_once __DIR__.'/Mime/SimpleMessageAcceptanceTest.php';
class Swift_MessageAcceptanceTest extends Swift_Mime_SimpleMessageAcceptanceTest
{
public function testAddPartWrapper()
{
$message = $this->_createMessage();
$message->setSubject('just a test subject');
$message->setFrom(array(
'chris.corbyn@swiftmailer.org' => 'Chris Corbyn', ));
$id = $message->getId();
$date = $message->getDate();
$boundary = $message->getBoundary();
$message->addPart('foo', 'text/plain', 'iso-8859-1');
$message->addPart('test <b>foo</b>', 'text/html', 'iso-8859-1');
$this->assertEquals(
'Message-ID: <'.$id.'>'."rn".
'Date: '.date('r', $date)."rn".
'Subject: just a test subject'."rn".
'From: Chris Corbyn <chris.corbyn@swiftmailer.org>'."rn".
'MIME-Version: 1.0'."rn".
'Content-Type: multipart/alternative;'."rn".
' boundary="'.$boundary.'"'."rn".
"rnrn".
'--'.$boundary."rn".
'Content-Type: text/plain; charset=iso-8859-1'."rn".
'Content-Transfer-Encoding: quoted-printable'."rn".
"rn".
'foo'.
"rnrn".
'--'.$boundary."rn".
'Content-Type: text/html; charset=iso-8859-1'."rn".
'Content-Transfer-Encoding: quoted-printable'."rn".
"rn".
'test <b>foo</b>'.
"rnrn".
'--'.$boundary.'--'."rn",
$message->toString()
);
}
protected function _createMessage()
{
Swift_DependencyContainer::getInstance()
->register('properties.charset')->asValue(null);
return Swift_Message::newInstance();
}
}