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

Commit

Permalink
Merge branch 'develop' of github.com:zendframework/zf2 into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 13 deletions.
3 changes: 2 additions & 1 deletion src/Message.php
Expand Up @@ -256,7 +256,8 @@ public static function createFromMessage($message, $boundary, $EOL = Mime::LINEE
$properties['language'] = $fieldValue;
break;
default:
throw new Exception\RuntimeException('Unknown header ignored for MimePart:' . $fieldName);
// Ignore unknown header
break;
}
}

Expand Down
4 changes: 0 additions & 4 deletions test/MessageTest.php
Expand Up @@ -5,17 +5,13 @@
* @link http://github.com/zendframework/zf2 for the canonical source repository
* @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @package Zend_Mime
*/

namespace ZendTest\Mime;

use Zend\Mime;

/**
* @category Zend
* @package Zend_Mime
* @subpackage UnitTests
* @group Zend_Mime
*/
class MessageTest extends \PHPUnit_Framework_TestCase
Expand Down
34 changes: 30 additions & 4 deletions test/MimeTest.php
Expand Up @@ -5,17 +5,13 @@
* @link http://github.com/zendframework/zf2 for the canonical source repository
* @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @package Zend_Mime
*/

namespace ZendTest\Mime;

use Zend\Mime;

/**
* @category Zend
* @package Zend_Mime
* @subpackage UnitTests
* @group Zend_Mime
*/
class MimeTest extends \PHPUnit_Framework_TestCase
Expand Down Expand Up @@ -135,6 +131,36 @@ public static function dataTestEncodeMailHeaderBase64()
);
}

public function testFromMessageMultiPart()
{
$message = Mime\Message::createFromMessage(
'--089e0141a1902f83ee04e0a07b7a'."\r\n"
.'Content-Type: multipart/alternative; boundary=089e0141a1902f83e904e0a07b78'."\r\n"
."\r\n"
.'--089e0141a1902f83e904e0a07b78'."\r\n"
.'Content-Type: text/plain; charset=UTF-8'."\r\n"
."\r\n"
.'Foo'."\r\n"
."\r\n"
.'--089e0141a1902f83e904e0a07b78'."\r\n"
.'Content-Type: text/html; charset=UTF-8'."\r\n"
."\r\n"
.'<p>Foo</p>'."\r\n"
."\r\n"
.'--089e0141a1902f83e904e0a07b78--'."\r\n"
.'--089e0141a1902f83ee04e0a07b7a'."\r\n"
.'Content-Type: image/png; name="1.png"'."\r\n"
.'Content-Disposition: attachment; filename="1.png"'."\r\n"
.'Content-Transfer-Encoding: base64'."\r\n"
.'X-Attachment-Id: barquux'."\r\n"
."\r\n"
.'Zm9vCg=='."\r\n"
.'--089e0141a1902f83ee04e0a07b7a--',
'089e0141a1902f83ee04e0a07b7a'
);
$this->assertSame(2, count($message->getParts()));
}

public static function dataTestFromMessageDecode()
{
return array(
Expand Down
4 changes: 0 additions & 4 deletions test/PartTest.php
Expand Up @@ -5,17 +5,13 @@
* @link http://github.com/zendframework/zf2 for the canonical source repository
* @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @package Zend_Mime
*/

namespace ZendTest\Mime;

use Zend\Mime;

/**
* @category Zend
* @package Zend_Mime
* @subpackage UnitTests
* @group Zend_Mime
*/
class PartTest extends \PHPUnit_Framework_TestCase
Expand Down

0 comments on commit 98b3922

Please sign in to comment.