<file name="attachment.bin" role="test" />
<file name="bug_325.txt" role="test" />
<file name="sample_msg.txt" role="test" />
+ <file name="uudecode.txt" role="test" />
</dir> <!-- /test/Horde/Mime/fixtures -->
+ <file name="AddressTest.php" role="test" />
<file name="AllTests.php" role="test" />
- <file name="bug_325.phpt" role="test" />
- <file name="bug_4834.phpt" role="test" />
- <file name="bug_6896.phpt" role="test" />
+ <file name="MagicTest.php" role="test" />
+ <file name="MimeTest.php" role="test" />
+ <file name="PartTest.php" role="test" />
<file name="mail_001.phpt" role="test" />
<file name="mail_002.phpt" role="test" />
<file name="mail_003.phpt" role="test" />
<file name="mail_007.phpt" role="test" />
<file name="mail_008.phpt" role="test" />
<file name="mail_dummy.inc" role="test" />
- <file name="parse_001.phpt" role="test" />
- <file name="parse_002.phpt" role="test" />
- <file name="parse_003.phpt" role="test" />
- <file name="rfc2231.phpt" role="test" />
</dir> <!-- /test/Horde/Mime -->
</dir> <!-- /test/Horde -->
</dir> <!-- /test -->
--- /dev/null
+<?php
+/**
+ * Tests for the Horde_Mime_Address class.
+ *
+ * Copyright 2010 The Horde Project (http://www.horde.org/)
+ *
+ * @author Michael Slusarz <slusarz@curecanti.org>
+ * @category Horde
+ * @license http://www.fsf.org/copyleft/lgpl.html LGPL
+ * @package Mime
+ * @subpackage UnitTests
+ */
+
+/**
+ * @author Michael Slusarz <slusarz@curecanti.org>
+ * @category Horde
+ * @license http://www.fsf.org/copyleft/lgpl.html LGPL
+ * @package Mime
+ * @subpackage UnitTests
+ */
+class Horde_Mime_AddressTest extends PHPUnit_Framework_TestCase
+{
+ public function testWriteAddress()
+ {
+ $host = 'example.com';
+ $mailbox = 'foo';
+ $personal = 'Example';
+
+ $this->assertEquals(
+ 'Example <foo@example.com>',
+ Horde_Mime_Address::writeAddress($mailbox, $host, $personal)
+ );
+ }
+
+ public function testTrimAddress()
+ {
+ $this->assertEquals(
+ 'foo@example.com',
+ Horde_Mime_Address::trimAddress('<foo@example.com>')
+ );
+ $this->assertEquals(
+ 'Foo <foo@example.com>',
+ Horde_Mime_Address::trimAddress('Foo <foo@example.com>')
+ );
+ }
+
+ public function testAddrObject2String()
+ {
+ $ob = Horde_Mime_Address::parseAddressList('<foo@example.com>');
+ $this->assertEquals(
+ 'foo@example.com',
+ Horde_Mime_Address::addrObject2String(reset($ob))
+ );
+
+ $ob = Horde_Mime_Address::parseAddressList('Foo <foo@example.com> ');
+ $this->assertEquals(
+ 'Foo <foo@example.com>',
+ Horde_Mime_Address::addrObject2String(reset($ob))
+ );
+ }
+
+ public function testBareAddress()
+ {
+ $this->assertEquals(
+ 'foo@example.com',
+ Horde_Mime_Address::bareAddress('<foo@example.com>')
+ );
+ $this->assertEquals(
+ 'foo@example.com',
+ Horde_Mime_Address::bareAddress('Foo <foo@example.com> ')
+ );
+ }
+
+ public function testBug6896()
+ {
+ // Bug #6896: explode() parsing broken
+ $str = 'addr1@example.com, addr2@example.com';
+
+ $this->assertEquals(
+ array(
+ 'addr1@example.com',
+ 'addr2@example.com'
+ ),
+ Horde_Mime_Address::explode($str)
+ );
+ }
+
+}
--- /dev/null
+<?php
+/**
+ * Tests for the Horde_Mime_Magic class.
+ *
+ * Copyright 2010 The Horde Project (http://www.horde.org/)
+ *
+ * @author Michael Slusarz <slusarz@curecanti.org>
+ * @category Horde
+ * @license http://www.fsf.org/copyleft/lgpl.html LGPL
+ * @package Mime
+ * @subpackage UnitTests
+ */
+
+/**
+ * @author Michael Slusarz <slusarz@curecanti.org>
+ * @category Horde
+ * @license http://www.fsf.org/copyleft/lgpl.html LGPL
+ * @package Mime
+ * @subpackage UnitTests
+ */
+class Horde_Mime_MagicTest extends PHPUnit_Framework_TestCase
+{
+ public function testBug325()
+ {
+ if (!extension_loaded('fileinfo')) {
+ $this->markTestSkipped('The fileinfo extension is not available.');
+ }
+
+ $this->assertEquals(
+ 'text/plain',
+ Horde_Mime_Magic::analyzeFile(dirname(__FILE__) . '/fixtures/bug_325.txt')
+ );
+ }
+
+}
--- /dev/null
+<?php
+/**
+ * Tests for the Horde_Mime class.
+ *
+ * Copyright 2010 The Horde Project (http://www.horde.org/)
+ *
+ * @author Michael Slusarz <slusarz@curecanti.org>
+ * @category Horde
+ * @license http://www.fsf.org/copyleft/lgpl.html LGPL
+ * @package Mime
+ * @subpackage UnitTests
+ */
+
+/**
+ * @author Michael Slusarz <slusarz@curecanti.org>
+ * @category Horde
+ * @license http://www.fsf.org/copyleft/lgpl.html LGPL
+ * @package Mime
+ * @subpackage UnitTests
+ */
+class Horde_Mime_MimeTest extends PHPUnit_Framework_TestCase
+{
+ public function testUudecode()
+ {
+ $data = Horde_Mime::uudecode(file_get_contents(dirname(__FILE__) . '/fixtures/uudecode.txt'));
+
+ $this->assertEquals(
+ 2,
+ count($data)
+ );
+
+ $this->assertArrayHasKey('data', $data[0]);
+ $this->assertEquals(
+ 'Test string',
+ $data[0]['data']
+ );
+ $this->assertArrayHasKey('name', $data[0]);
+ $this->assertEquals(
+ 'test.txt',
+ $data[0]['name']
+ );
+ $this->assertArrayHasKey('perm', $data[0]);
+ $this->assertEquals(
+ '644',
+ $data[0]['perm']
+ );
+
+ $this->assertArrayHasKey('data', $data[1]);
+ $this->assertEquals(
+ '2nd string',
+ $data[1]['data']
+ );
+ $this->assertArrayHasKey('name', $data[1]);
+ $this->assertEquals(
+ 'test2.txt',
+ $data[1]['name']
+ );
+ $this->assertArrayHasKey('perm', $data[1]);
+ $this->assertEquals(
+ '755',
+ $data[1]['perm']
+ );
+ }
+
+ public function testBug4834()
+ {
+ // Bug #4834: Wrong encoding of email lists with groups.
+ $addr = '"John Doe" <john@example.com>, Group: peter@example.com, jane@example.com;';
+ $expect = 'John Doe <john@example.com>, Group: peter@example.com, jane@example.com;';
+
+ $this->assertEquals(Horde_Mime::encodeAddress($addr, 'us-ascii'), $expect);
+ }
+
+ public function testRfc2231()
+ {
+ // Horde_Mime RFC 2231 & workaround for broken MUA's
+ $pname = 'test';
+ $str = str_repeat('a', 100) . '.txt';
+ $expected = array(
+ 'test' => 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.txt',
+ 'test*0' =>'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa',
+ 'test*1' => 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.txt'
+ );
+
+ Horde_Mime::$brokenRFC2231 = true;
+ $this->assertEquals(Horde_Mime::encodeParam($pname, $str, 'UTF-8'), $expected);
+
+ Horde_Mime::$brokenRFC2231 = false;
+ unset($expected['test']);
+ $this->assertEquals(Horde_Mime::encodeParam($pname, $str, 'UTF-8'), $expected);
+ }
+
+}
--- /dev/null
+<?php
+/**
+ * Tests for the Horde_Mime_Part class.
+ *
+ * Copyright 2010 The Horde Project (http://www.horde.org/)
+ *
+ * @author Michael Slusarz <slusarz@curecanti.org>
+ * @category Horde
+ * @license http://www.fsf.org/copyleft/lgpl.html LGPL
+ * @package Mime
+ * @subpackage UnitTests
+ */
+
+/**
+ * @author Michael Slusarz <slusarz@curecanti.org>
+ * @category Horde
+ * @license http://www.fsf.org/copyleft/lgpl.html LGPL
+ * @package Mime
+ * @subpackage UnitTests
+ */
+class Horde_Mime_PartTest extends PHPUnit_Framework_TestCase
+{
+ public function testParseMessage()
+ {
+ $msg = file_get_contents(dirname(__FILE__) . '/fixtures/sample_msg.txt');
+ $part = Horde_Mime_Part::parseMessage($msg);
+
+ $this->assertEquals(
+ 'multipart/mixed',
+ $part->getType()
+ );
+ $this->assertEquals(
+ 1869,
+ $part->getBytes()
+ );
+ $this->assertEquals(
+ '=_k4kgcwkwggwc',
+ $part->getContentTypeParameter('boundary')
+ );
+
+ $part_1 = $part->getPart(1);
+ $this->assertEquals(
+ 'text/plain',
+ $part_1->getType()
+ );
+ $this->assertEquals(
+ 'flowed',
+ $part_1->getContentTypeParameter('format')
+ );
+
+ $part_2 = $part->getPart(2);
+ $this->assertEquals(
+ 'message/rfc822',
+ $part_2->getType()
+ );
+ $part_2_2 = $part->getPart(2.2);
+ $this->assertEquals(
+ 'text/plain',
+ $part_2_2->getType()
+ );
+ $this->assertEquals(
+ 'test.txt',
+ $part_2_2->getDispositionParameter('filename')
+ );
+
+ $part_3 = $part->getPart(3);
+ $this->assertEquals(
+ 'image/png',
+ $part_3->getType()
+ );
+
+ $this->assertEquals(
+ "Test text.\n\n",
+ Horde_Mime_Part::getRawPartText($msg, 'body', '2.1')
+ );
+
+ $this->assertEquals(
+ "Content-Type: image/png; name=index.png\n" .
+ "Content-Disposition: attachment; filename=index.png\n" .
+ 'Content-Transfer-Encoding: base64',
+ Horde_Mime_Part::getRawPartText($msg, 'header', '3')
+ );
+ }
+
+}
+++ /dev/null
---TEST--
-Bug #338 (fileinfo returning charset)
---SKIPIF--
-<?php if (!extension_loaded('fileinfo')) echo 'skip No fileinfo extension installed'; ?>
---FILE--
-<?php
-require_once 'Horde/Util.php';
-require dirname(__FILE__) . '/../../../lib/Horde/Mime/Magic.php';
-echo Horde_Mime_Magic::analyzeFile(dirname(__FILE__) . '/fixtures/bug_325.txt');
-?>
---EXPECT--
-text/plain
+++ /dev/null
---TEST--
-Bug #4834 Wrong encoding of email lists with groups.
---FILE--
-<?php
-
-require_once 'Mail/RFC822.php';
-require_once 'Horde/Browser.php';
-require_once 'Horde/Nls.php';
-require_once 'Horde/String.php';
-require dirname(__FILE__) . '/../../../lib/Horde/Mime.php';
-require dirname(__FILE__) . '/../../../lib/Horde/Mime/Address.php';
-echo Horde_Mime::encodeAddress('"John Doe" <john@example.com>, Group: peter@example.com, jane@example.com;', 'us-ascii');
-
-?>
---EXPECT--
-John Doe <john@example.com>, Group: peter@example.com, jane@example.com;
+++ /dev/null
---TEST--
-Bug #6896 MIME::rfc822Explode parsing broken
---FILE--
-<?php
-
-require dirname(__FILE__) . '/../../../lib/Horde/Mime/Address.php';
-var_dump(Horde_Mime_Address::explode('addr1@example.com, addr2@example.com'));
-
-?>
---EXPECT--
-array(2) {
- [0]=>
- string(17) "addr1@example.com"
- [1]=>
- string(18) " addr2@example.com"
-}
--- /dev/null
+
+Ignore this text.
+
+begin 644 test.txt
++5&5S="!S=')I;F<`
+`
+end
+
+More text to ignore.
+
+begin 755 test2.txt
+*,FYD('-T<FEN9P``
+`
+end
+
+++ /dev/null
---TEST--
-Horde_Mime_Part::parseMessage() [Structure array] test
---FILE--
-<?php
-
-require_once dirname(__FILE__) . '/../../../lib/Horde/Mime.php';
-require_once dirname(__FILE__) . '/../../../lib/Horde/Mime/Address.php';
-require_once dirname(__FILE__) . '/../../../lib/Horde/Mime/Headers.php';
-require_once dirname(__FILE__) . '/../../../lib/Horde/Mime/Part.php';
-require_once 'Horde/String.php';
-require_once 'Mail/RFC822.php';
-
-$data = file_get_contents(dirname(__FILE__) . '/fixtures/sample_msg.txt');
-
-print_r(Horde_Mime_Part::parseMessage($data, array('structure' => true)));
-
-?>
---EXPECTF--
-Array
-(
- [parts] => Array
- (
- [0] => Array
- (
- [parts] => Array
- (
- )
-
- [subtype] => plain
- [type] => text
- [encoding] => 7bit
- [dparameters] => Array
- (
- )
-
- [parameters] => Array
- (
- [charset] => UTF-8
- [DelSp] => Yes
- [format] => flowed
- )
-
- [disposition] => inline
- [contents] => Test.
-
-
- [size] => 9
- )
-
- [1] => Array
- (
- [parts] => Array
- (
- [0] => Array
- (
- [parts] => Array
- (
- [0] => Array
- (
- [parts] => Array
- (
- )
-
- [subtype] => plain
- [type] => text
- [encoding] => 7bit
- [dparameters] => Array
- (
- )
-
- [parameters] => Array
- (
- [charset] => UTF-8
- [DelSp] => Yes
- [format] => flowed
- )
-
- [disposition] => inline
- [contents] => Test text.
-
-
- [size] => 14
- )
-
- [1] => Array
- (
- [parts] => Array
- (
- )
-
- [subtype] => plain
- [type] => text
- [encoding] => 7bit
- [dparameters] => Array
- (
- [filename] => test.txt
- )
-
- [parameters] => Array
- (
- [charset] => UTF-8
- [name] => test.txt
- )
-
- [disposition] => attachment
- [contents] => Test.
-
- [size] => 7
- )
-
- )
-
- [subtype] => mixed
- [type] => multipart
- [encoding] => 7bit
- [dparameters] =>
- [parameters] => Array
- (
- [boundary] => =_8w0gkwkgk44o
- )
-
- [contents] => This message is in MIME format.
-
---=_8w0gkwkgk44o
-Content-Type: text/plain; charset=UTF-8; format=flowed; DelSp=Yes
-Content-Disposition: inline
-Content-Transfer-Encoding: 7bit
-
-Test text.
-
-
---=_8w0gkwkgk44o
-Content-Type: text/plain; charset=UTF-8; name=test.txt
-Content-Disposition: attachment; filename=test.txt
-Content-Transfer-Encoding: 7bit
-
-Test.
-
---=_8w0gkwkgk44o--
-
-
- [size] => 392
- )
-
- )
-
- [subtype] => rfc822
- [type] => message
- [dparameters] =>
- [parameters] => Array
- (
- [name] => Forwarded Message
- )
-
- [contents] => Return-Path: <foo@example.com>
-Delivered-To: test@example.com
-Received: from localhost (localhost [127.0.0.1])
- by example.com (Postfix) with ESMTP id B09464F220
- for <test@example.com>; Tue, 7 Jul 2009 11:49:00 -0600 (MDT)
-Message-ID: <20090707114900.4w4ksggowkc4@example.com>
-Date: Tue, 07 Jul 2009 11:49:00 -0600
-From: Foo <foo@example.com>
-To: test@example.com
-Subject: Test
-User-Agent: Internet Messaging Program (IMP) H4 (5.0-git)
-Content-Type: multipart/mixed; boundary="=_8w0gkwkgk44o"
-MIME-Version: 1.0
-Content-Transfer-Encoding: 7bit
-
-This message is in MIME format.
-
---=_8w0gkwkgk44o
-Content-Type: text/plain; charset=UTF-8; format=flowed; DelSp=Yes
-Content-Disposition: inline
-Content-Transfer-Encoding: 7bit
-
-Test text.
-
-
---=_8w0gkwkgk44o
-Content-Type: text/plain; charset=UTF-8; name=test.txt
-Content-Disposition: attachment; filename=test.txt
-Content-Transfer-Encoding: 7bit
-
-Test.
-
---=_8w0gkwkgk44o--
-
-
- )
-
- [2] => Array
- (
- [parts] => Array
- (
- )
-
- [subtype] => png
- [type] => image
- [encoding] => base64
- [dparameters] => Array
- (
- [filename] => index.png
- )
-
- [parameters] => Array
- (
- [name] => index.png
- )
-
- [disposition] => attachment
- [contents] => iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAQAAAC1+jfqAAAABGdBTUEAAK/INwWK6QAAABl0RVh0
-U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAADoSURBVBgZBcExblNBGAbA2ceegTRBuIKO
-giihSZNTcC5LUHAihNJR0kGKCDcYJY6D3/77MdOinTvzAgCw8ysThIvn/VojIyMjIyPP+bS1sUQI
-V2s95pBDDvmbP/mdkft83tpYguZq5Jh/OeaYh+yzy8hTHvNlaxNNczm+la9OTlar1UdA/+C2A4tr
-RCnD3jS8BB1obq2Gk6GU6QbQAS4BUaYSQAf4bhhKKTFdAzrAOwAxEUAH+KEM01SY3gM6wBsEAQB0
-gJ+maZoC3gI6iPYaAIBJsiRmHU0AALOeFC3aK2cWAACUXe7+AwO0lc9eTHYTAAAAAElFTkSuQmCC
- [size] => 466
- )
-
- )
-
- [subtype] => mixed
- [type] => multipart
- [encoding] => 7bit
- [dparameters] =>
- [parameters] => Array
- (
- [boundary] => =_k4kgcwkwggwc
- )
-
- [contents] => This message is in MIME format.
-
---=_k4kgcwkwggwc
-Content-Type: text/plain; charset=UTF-8; format=flowed; DelSp=Yes
-Content-Disposition: inline
-Content-Transfer-Encoding: 7bit
-
-Test.
-
-
---=_k4kgcwkwggwc
-Content-Type: message/rfc822; name="Forwarded Message"
-
-Return-Path: <foo@example.com>
-Delivered-To: test@example.com
-Received: from localhost (localhost [127.0.0.1])
- by example.com (Postfix) with ESMTP id B09464F220
- for <test@example.com>; Tue, 7 Jul 2009 11:49:00 -0600 (MDT)
-Message-ID: <20090707114900.4w4ksggowkc4@example.com>
-Date: Tue, 07 Jul 2009 11:49:00 -0600
-From: Foo <foo@example.com>
-To: test@example.com
-Subject: Test
-User-Agent: Internet Messaging Program (IMP) H4 (5.0-git)
-Content-Type: multipart/mixed; boundary="=_8w0gkwkgk44o"
-MIME-Version: 1.0
-Content-Transfer-Encoding: 7bit
-
-This message is in MIME format.
-
---=_8w0gkwkgk44o
-Content-Type: text/plain; charset=UTF-8; format=flowed; DelSp=Yes
-Content-Disposition: inline
-Content-Transfer-Encoding: 7bit
-
-Test text.
-
-
---=_8w0gkwkgk44o
-Content-Type: text/plain; charset=UTF-8; name=test.txt
-Content-Disposition: attachment; filename=test.txt
-Content-Transfer-Encoding: 7bit
-
-Test.
-
---=_8w0gkwkgk44o--
-
-
---=_k4kgcwkwggwc
-Content-Type: image/png; name=index.png
-Content-Disposition: attachment; filename=index.png
-Content-Transfer-Encoding: base64
-
-iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAQAAAC1+jfqAAAABGdBTUEAAK/INwWK6QAAABl0RVh0
-U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAADoSURBVBgZBcExblNBGAbA2ceegTRBuIKO
-giihSZNTcC5LUHAihNJR0kGKCDcYJY6D3/77MdOinTvzAgCw8ysThIvn/VojIyMjIyPP+bS1sUQI
-V2s95pBDDvmbP/mdkft83tpYguZq5Jh/OeaYh+yzy8hTHvNlaxNNczm+la9OTlar1UdA/+C2A4tr
-RCnD3jS8BB1obq2Gk6GU6QbQAS4BUaYSQAf4bhhKKTFdAzrAOwAxEUAH+KEM01SY3gM6wBsEAQB0
-gJ+maZoC3gI6iPYaAIBJsiRmHU0AALOeFC3aK2cWAACUXe7+AwO0lc9eTHYTAAAAAElFTkSuQmCC
---=_k4kgcwkwggwc--
-
- [size] => 1869
-)
+++ /dev/null
---TEST--
-Horde_Mime_Part::parseMessage() [Horde_Mime_Part] test
---FILE--
-<?php
-
-require_once dirname(__FILE__) . '/../../../lib/Horde/Mime.php';
-require_once dirname(__FILE__) . '/../../../lib/Horde/Mime/Address.php';
-require_once dirname(__FILE__) . '/../../../lib/Horde/Mime/Headers.php';
-require_once dirname(__FILE__) . '/../../../lib/Horde/Mime/Part.php';
-require_once 'Horde/String.php';
-require_once 'Mail/RFC822.php';
-
-$data = file_get_contents(dirname(__FILE__) . '/fixtures/sample_msg.txt');
-
-$ob = Horde_Mime_Part::parseMessage($data);
-print_r($ob->getType());
-
-?>
---EXPECTF--
-multipart/mixed
+++ /dev/null
---TEST--
-Horde_Mime_Part::getRawPartText() test
---FILE--
-<?php
-
-require_once dirname(__FILE__) . '/../../../lib/Horde/Mime.php';
-require_once dirname(__FILE__) . '/../../../lib/Horde/Mime/Address.php';
-require_once dirname(__FILE__) . '/../../../lib/Horde/Mime/Headers.php';
-require_once dirname(__FILE__) . '/../../../lib/Horde/Mime/Part.php';
-require_once 'Horde/String.php';
-require_once 'Mail/RFC822.php';
-
-$data = file_get_contents(dirname(__FILE__) . '/fixtures/sample_msg.txt');
-
-print_r(Horde_Mime_Part::getRawPartText($data, 'body', '2.1'));
-echo "---\n";
-print_r(Horde_Mime_Part::getRawPartText($data, 'header', '3'));
-
-?>
---EXPECTF--
-Test text.
-
----
-Content-Type: image/png; name=index.png
-Content-Disposition: attachment; filename=index.png
-Content-Transfer-Encoding: base64
+++ /dev/null
---TEST--
-Horde_Mime RFC 2231 & workaround for broken MUA's
---FILE--
-<?php
-
-require dirname(__FILE__) . '/../../../lib/Horde/Mime.php';
-require_once 'Horde/String.php';
-require_once 'Horde/Util.php';
-
-Horde_Mime::$brokenRFC2231 = true;
-var_dump(Horde_Mime::encodeParam('test', str_repeat('a', 100) . '.txt', 'UTF-8'));
-
-?>
---EXPECT--
-array(3) {
- ["test"]=>
- string(104) "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.txt"
- ["test*0"]=>
- string(68) "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
- ["test*1"]=>
- string(36) "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.txt"
-}
+++ /dev/null
---TEST--
-Horde_Mime::uudecode() test
---FILE--
-<?php
-
-require dirname(__FILE__) . '/../../../lib/Horde/Mime.php';
-
-$encode_1 = convert_uuencode("Test string");
-$encode_2 = convert_uuencode("2nd string");
-
-$data = <<<EOF
-
-Ignore this text.
-
-begin 644 test.txt
-$encode_1
-end
-
-More text to ignore.
-
-begin 644 test2.txt
-$encode_2
-end
-EOF;
-
-var_dump(Horde_Mime::uudecode($data));
-
-?>
---EXPECT--
-array(2) {
- [0]=>
- array(3) {
- ["data"]=>
- string(11) "Test string"
- ["name"]=>
- string(8) "test.txt"
- ["perm"]=>
- string(3) "644"
- }
- [1]=>
- array(3) {
- ["data"]=>
- string(10) "2nd string"
- ["name"]=>
- string(9) "test2.txt"
- ["perm"]=>
- string(3) "644"
- }
-}