Warning: Cannot modify header information - headers already sent by (output started at /var/www/jonas-eriksen.dk/pic/private/index.php:1) in /var/www/jonas-eriksen.dk/pic/private/index.php on line 215
PK ! )f$á! ! tests/rfc822.phptnu ÕIw¶´ --TEST--
Mail_RFC822: Address Parsing
--FILE--
parseAddressList($address, null, true, true));
/* Address groups. */
$address = 'My Group: "Richard" (A comment), ted@example.com (Ted Bloggs), Barney;';
print_r($parser->parseAddressList($address, null, true, true));
/* A valid address with spaces in the local part. */
$address = '<"Jon Parise"@php.net>';
print_r($parser->parseAddressList($address, null, true, true));
/* An invalid address with spaces in the local part. */
$address = '';
$result = $parser->parseAddressList($address, null, true, true);
if (is_a($result, 'PEAR_Error')) echo $result->getMessage() . "\n";
/* A valid address with an uncommon TLD. */
$address = 'jon@host.longtld';
$result = $parser->parseAddressList($address, null, true, true);
if (is_a($result, 'PEAR_Error')) echo $result->getMessage() . "\n";
--EXPECT--
Array
(
[0] => stdClass Object
(
[personal] =>
[comment] => Array
(
)
[mailbox] => user
[host] => example.com
)
)
Array
(
[0] => stdClass Object
(
[groupname] => My Group
[addresses] => Array
(
[0] => stdClass Object
(
[personal] => "Richard"
[comment] => Array
(
[0] => A comment
)
[mailbox] => richard
[host] => localhost
)
[1] => stdClass Object
(
[personal] =>
[comment] => Array
(
[0] => Ted Bloggs
)
[mailbox] => ted
[host] => example.com
)
[2] => stdClass Object
(
[personal] =>
[comment] => Array
(
)
[mailbox] => Barney
[host] => localhost
)
)
)
)
Array
(
[0] => stdClass Object
(
[personal] =>
[comment] => Array
(
)
[mailbox] => "Jon Parise"
[host] => php.net
)
)
Validation failed for:
PK ! *ˆ¨é é tests/9137.phptnu ÕIw¶´ --TEST--
Mail: Test for bug #9137
--FILE--
'John Doe', 'email' => 'test@example.com'),
array('name' => 'John Doe\\', 'email' => 'test@example.com'),
array('name' => 'John "Doe', 'email' => 'test@example.com'),
array('name' => 'John "Doe\\', 'email' => 'test@example.com'),
);
for ($i = 0; $i < count($addresses); $i++) {
// construct the address
$address = "\"" . addslashes($addresses[$i]['name']) . "\" ".
"<".$addresses[$i]['email'].">";
$parsedAddresses = Mail_RFC822::parseAddressList($address);
if (is_a($parsedAddresses, 'PEAR_Error')) {
echo $address." :: Failed to validate\n";
} else {
echo $address." :: Parsed\n";
}
}
--EXPECT--
"John Doe" :: Parsed
"John Doe\\" :: Parsed
"John \"Doe" :: Parsed
"John \"Doe\\" :: Parsed
PK ! ¨x`(¥ ¥ tests/bug17317.phptnu ÕIw¶´ --TEST--
Mail_RFC822::parseAddressList invalid periods in mail address
--FILE--
(test)';
$parser = new Mail_RFC822();
$result = $parser->parseAddressList($address, 'anydomain.com', TRUE);
if (!PEAR::isError($result) && is_array($result) && is_object($result[0]))
if ($result[0]->personal == '"Test Student"' &&
$result[0]->mailbox == "test" &&
$result[0]->host == "mydomain.com" &&
is_array($result[0]->comment) && $result[0]->comment[0] == 'test')
{
print("OK");
}
?>
--EXPECT--
OK
PK ! wŒ·¶ó ó tests/smtp_error.phptnu ÕIw¶´ --TEST--
Mail: SMTP Error Reporting
--SKIPIF--
packageExists('Net_SMTP')) die("skip\n");
--FILE--
'bogus.host.tld');
/* Create our SMTP-based mailer object. */
$mailer = Mail::factory('smtp', $params);
/* Attempt to send an empty message in order to trigger an error. */
$e = $mailer->send(array(), array(), '');
if (is_a($e, 'PEAR_Error')) {
$err = $e->getMessage();
if (preg_match('/Failed to connect to bogus.host.tld:25 \[SMTP: Failed to connect socket:.*/i', $err)) {
echo "OK";
}
}
--EXPECT--
OKPK ! 8xý½ä ä tests/bug17178.phptnu ÕIw¶´ --TEST--
Mail_RFC822::parseAddressList does not accept RFC-valid group syntax
--FILE--
'"John Doe" '),
array('raw' => '"John Doe' . chr(92) . '" '),
array('raw' => '"John Doe' . chr(92) . chr(92) . '" '),
array('raw' => '"John Doe' . chr(92) . chr(92) . chr(92) . '" '),
array('raw' => '"John Doe' . chr(92) . chr(92) . chr(92) . chr(92) . '" '),
array('raw' => '"John Doe '),
);
for ($i = 0; $i < count($addresses); $i++) {
// construct the address
$address = $addresses[$i]['raw'];
$parsedAddresses = Mail_RFC822::parseAddressList($address);
if (PEAR::isError($parsedAddresses)) {
echo $address." :: Failed to validate\n";
} else {
echo $address." :: Parsed\n";
}
}
--EXPECT--
"John Doe" :: Parsed
"John Doe\" :: Failed to validate
"John Doe\\" :: Parsed
"John Doe\\\" :: Failed to validate
"John Doe\\\\" :: Parsed
"John Doe :: Failed to validate
PK ! )f$á! ! tests/rfc822.phptnu ÕIw¶´ PK ! *ˆ¨é é b tests/9137.phptnu ÕIw¶´ PK ! ¨x`(¥ ¥ Š tests/bug17317.phptnu ÕIw¶´ PK ! ¨žq/‰ ‰ r tests/13659.phptnu ÕIw¶´ PK ! wŒ·¶ó ó ; tests/smtp_error.phptnu ÕIw¶´ PK ! 8xý½ä ä s tests/bug17178.phptnu ÕIw¶´ PK ! Ìó†Ê Ê š tests/9137_2.phptnu ÕIw¶´ PK < ¥