use PHPUnit\Framework\TestCase;
use Symfony\Component\Mime\Address;
use Symfony\Component\Mime\Header\MailboxListHeader;
class MailboxListHeaderTest extends TestCase
{ // RFC 2822, 3.6.2 for all tests
public function testMailboxIsSetForAddress() { $header =
new MailboxListHeader('From',
[new Address('chris@swiftmailer.org'
)]);
$this->
assertEquals(['chris@swiftmailer.org'
],
$header->
getAddressStrings());
} public function testMailboxIsRenderedForNameAddress() { $header =
new MailboxListHeader('From',
[new Address('chris@swiftmailer.org', 'Chris Corbyn'
)]);
$this->
assertEquals(['Chris Corbyn <chris@swiftmailer.org>'
],
$header->
getAddressStrings());
} public function testAddressCanBeReturnedForAddress() { $header =
new MailboxListHeader('From',
$addresses =
[new Address('chris@swiftmailer.org'
)]);