13 require_once
'PU_testcase_dcp.php';
22 $p = new \Dcp\Mail\MailAddrParser();
26 $addrList = $p->parse($str);
28 catch(\Dcp\Mail\MailAddrParserException $e) {
29 $err = $e->getMessage();
31 $this->assertEmpty(
$err, sprintf(
"Unexpected parse error: %s",
$err));
32 foreach ($expectedMails as $expected) {
34 foreach ($addrList as $addr) {
35 if ($addr->address == $expected) {
40 $this->assertTrue($found, sprintf(
"Expected address '%s' not found in [%s].", $expected, $str));
48 'foo.bar@example.net',
54 'bill.o\'reilly@example.net',
56 'bill.o\'reilly@example.net'
60 ' John "Doe" Junior <john.doe@example.net> , "Foo \\"Bar, Baz\\" Buz" <foo.buz@example.net> ,
61 Bill O\'Reilly <bill.o\'reilly@example.net>,
64 "Foo <ACME Corp.>" <foo@acme.corp>
67 'john.doe@example.net',
68 'foo.buz@example.net',
69 'bill.o\'reilly@example.net',
70 'foo.bar@example.net',
testMailAddrParser($str, $expectedMails)
if($file) if($subject==""&&$file) if($subject=="") $err