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

Commit

Permalink
tests: add test with paren in name
Browse files Browse the repository at this point in the history
  • Loading branch information
glensc committed May 20, 2017
1 parent f0c2002 commit 9d5d8bb
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion test/AddressListTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,17 @@

use Zend\Mail\Address;
use Zend\Mail\AddressList;
use Zend\Mail\Header;

/**
* @group Zend_Mail
* @covers Zend\Mail\AddressList<extended>
* @covers \Zend\Mail\AddressList<extended>
*/
class AddressListTest extends \PHPUnit_Framework_TestCase
{
/** @var AddressList */
private $list;

public function setUp()
{
$this->list = new AddressList();
Expand Down Expand Up @@ -91,6 +95,16 @@ public function testCanAddManyAddressesAtOnce()
$this->assertTrue($this->list->has('fw-announce@lists.zend.com'));
}

public function testLosesParensInName() {
$header = '"Supports (E-mail)" <support@example.org>';

$to = Header\To::fromString('To:' . $header);
$addressList = $to->getAddressList();
$address = $addressList->get('support@example.org');
$this->assertEquals('Supports (E-mail)', $address->getName());
$this->assertEquals('support@example.org', $address->getEmail());
}

public function testDoesNotStoreDuplicatesAndFirstWins()
{
$addresses = [
Expand Down

0 comments on commit 9d5d8bb

Please sign in to comment.