$header =
new MailboxHeader('Sender',
new Address('fabien@symfony.com', 'Fabien Potencier'
));
$this->
assertEquals('Fabien Potencier <fabien@symfony.com>',
$header->
getBodyAsString());
$header =
new MailboxHeader('Sender',
new Address('fabien@symfony.com', 'Fabien Potencier, "from Symfony"'
));
$this->
assertEquals('"Fabien Potencier, \"from Symfony\"" <fabien@symfony.com>',
$header->
getBodyAsString());
$header =
new MailboxHeader('From',
new Address('fabien@symfony.com', 'Fabien Potencier, \\escaped\\'
));
$this->
assertEquals('"Fabien Potencier, \\\\escaped\\\\" <fabien@symfony.com>',
$header->
getBodyAsString());
$name = 'P'.
pack('C', 0x8F
).'tencier';
$header =
new MailboxHeader('Sender',
new Address('fabien@symfony.com', 'Fabien '.
$name));
$header->
setCharset('iso-8859-1'
);
$this->
assertEquals('Fabien =?'.
$header->
getCharset().'?Q?P=8Ftencier?= <fabien@symfony.com>',
$header->
getBodyAsString());
} public function testUtf8CharsInLocalPart() { $header =
new MailboxHeader('Sender',
new Address('fabïen@symfony.com'
));
$this->
assertSame('fabïen@symfony.com',
$header->
getBodyAsString());
} public function testToString() {