/usr/share/php/tests/Horde_Mail/Horde/Mail/SendTest.php is in php-horde-mail 2.1.4-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 | <?php
/**
* @author Michael Slusarz <slusarz@horde.org>
* @category Horde
* @license http://www.horde.org/licenses/bsd BSD
* @package Mail
* @subpackage UnitTests
*/
class Horde_Mail_SendTest extends PHPUnit_Framework_TestCase
{
/* Test case for mixed EOLs. */
public function testMixedEOLs()
{
$ob = new Horde_Mail_Transport_Mock();
$ob->sep = "\n";
$recipients = 'Test <test@example.com>';
$body = "Foo\r\nBar\nBaz\rTest";
$headers = array(
'To' => '<test2@example.com>',
'From' => '<foo@example.com>',
'Subject' => 'Test',
'X-Test' => 'Line 1\r\n\tLine 2\n\tLine 3\r\tLine 4',
'X-Truncated-Header' => $body
);
$ob->send($recipients, $headers, $body);
if (preg_match("/(?<=\r)\n/", $ob->sentMessages[0]['header_text'])) {
$this->fail("Unexpected EOL in headers.");
}
if (preg_match("/(?<=\r)\n/", $ob->sentMessages[0]['body'])) {
$this->fail("Unexpected EOL in body.");
}
$ob->sep = "\r\n";
$ob->send($recipients, $headers, $body);
if (preg_match("/(?<!\r)\n/", $ob->sentMessages[1]['header_text'])) {
$this->fail("Unexpected EOL in headers.");
}
if (preg_match("/(?<!\r)\n/", $ob->sentMessages[1]['body'])) {
$this->fail("Unexpected EOL in body.");
}
}
public function testBug12116()
{
$addr = new Horde_Mail_Rfc822_Address();
$addr->personal = 'Aäb';
$addr->mailbox = 'test';
$addr->host = 'üexample.com';
$ob = new Horde_Mail_Transport_Mock();
$ob->send(
array($addr),
array(
'Return-Path' => $addr
),
'Foo'
);
$this->assertEquals(
array('test@xn--example-m2a.com'),
$ob->sentMessages[0]['recipients']
);
$this->assertEquals(
'test@xn--example-m2a.com',
$ob->sentMessages[0]['from']
);
}
public function testMissingFrom()
{
$ob = new Horde_Mail_Transport_Mock();
try {
$ob->send(array('foo@example.com'), array(), 'Foo');
$this->fail('Expected Horde_Mail_Exception.');
} catch (Horde_Mail_Exception $e) {
}
}
}
|