Skip to content
This repository was archived by the owner on Jan 30, 2020. It is now read-only.

Commit 9d5d8bb

Browse files
committed
tests: add test with paren in name
1 parent f0c2002 commit 9d5d8bb

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

test/AddressListTest.php

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,17 @@
1111

1212
use Zend\Mail\Address;
1313
use Zend\Mail\AddressList;
14+
use Zend\Mail\Header;
1415

1516
/**
1617
* @group Zend_Mail
17-
* @covers Zend\Mail\AddressList<extended>
18+
* @covers \Zend\Mail\AddressList<extended>
1819
*/
1920
class AddressListTest extends \PHPUnit_Framework_TestCase
2021
{
22+
/** @var AddressList */
23+
private $list;
24+
2125
public function setUp()
2226
{
2327
$this->list = new AddressList();
@@ -91,6 +95,16 @@ public function testCanAddManyAddressesAtOnce()
9195
$this->assertTrue($this->list->has('fw-announce@lists.zend.com'));
9296
}
9397

98+
public function testLosesParensInName() {
99+
$header = '"Supports (E-mail)" <support@example.org>';
100+
101+
$to = Header\To::fromString('To:' . $header);
102+
$addressList = $to->getAddressList();
103+
$address = $addressList->get('support@example.org');
104+
$this->assertEquals('Supports (E-mail)', $address->getName());
105+
$this->assertEquals('support@example.org', $address->getEmail());
106+
}
107+
94108
public function testDoesNotStoreDuplicatesAndFirstWins()
95109
{
96110
$addresses = [

0 commit comments

Comments
 (0)