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

Commit 4caae3d

Browse files
committed
add test for #147 regression
1 parent ece418b commit 4caae3d

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

test/AddressListTest.php

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,4 +144,24 @@ public function testSemicolonSeparator()
144144
$this->assertTrue($addressList->has('[email protected]'));
145145
$this->assertTrue($addressList->has('[email protected]'));
146146
}
147+
148+
/**
149+
* If name-field is quoted with "", then ' inside it should not treated eqally.
150+
*/
151+
public function testMixedQuotesInName() {
152+
$header = '"Bob O\'Reilly" <[email protected]>,[email protected]';
153+
154+
// In previous versions, this throws: 'The input exceeds the allowed
155+
// length'; hence the try/catch block, to allow finding the root cause.
156+
try {
157+
$to = Header\To::fromString('To:' . $header);
158+
} catch (InvalidArgumentException $e) {
159+
$this->fail('Header\To::fromString should not throw');
160+
}
161+
162+
$addressList = $to->getAddressList();
163+
$this->assertTrue($addressList->has('[email protected]'));
164+
$this->assertTrue($addressList->has('[email protected]'));
165+
$this->assertEquals("Bob O'Reilly", $addressList->get('[email protected]')->getName());
166+
}
147167
}

0 commit comments

Comments
 (0)