This repository was archived by the owner on Jan 30, 2020. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +15
-1
lines changed Expand file tree Collapse file tree 1 file changed +15
-1
lines changed Original file line number Diff line number Diff line change 1111
1212use Zend \Mail \Address ;
1313use 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 */
1920class 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 = [
You can’t perform that action at this time.
0 commit comments