This repository has been archived by the owner on Jun 27, 2020. It is now read-only.
forked from zendframework/zend-mail
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'pull/226' into develop-2.10
port to this branch: zendframework#226
- Loading branch information
Showing
3 changed files
with
52 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -144,4 +144,26 @@ public function testSemicolonSeparator() | |
$this->assertTrue($addressList->has('[email protected]')); | ||
$this->assertTrue($addressList->has('[email protected]')); | ||
} | ||
|
||
/** | ||
* If name-field is quoted with "", then ' inside it should not treated as terminator, but as value. | ||
*/ | ||
public function testMixedQuotesInName() | ||
{ | ||
$header = '"Bob O\'Reilly" <[email protected]>,[email protected]'; | ||
|
||
// In previous versions, this throws: | ||
// 'Bob O'Reilly <bob@example.com>,blah' can not be matched against dot-atom format | ||
// hence the try/catch block, to allow finding the root cause. | ||
try { | ||
$to = Header\To::fromString('To:' . $header); | ||
} catch (InvalidArgumentException $e) { | ||
$this->fail('Header\To::fromString should not throw. Exception message: ' . $e->getMessage()); | ||
} | ||
|
||
$addressList = $to->getAddressList(); | ||
$this->assertTrue($addressList->has('[email protected]')); | ||
$this->assertTrue($addressList->has('[email protected]')); | ||
$this->assertEquals("Bob O'Reilly", $addressList->get('[email protected]')->getName()); | ||
} | ||
} |