Skip to content

Commit

Permalink
Add test
Browse files Browse the repository at this point in the history
  • Loading branch information
mrubinsk committed Jan 14, 2018
1 parent 80dc472 commit 85f59f1
Show file tree
Hide file tree
Showing 2 changed files with 118 additions and 0 deletions.
26 changes: 26 additions & 0 deletions test/Horde/ActiveSync/MimeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -95,4 +95,30 @@ public function testHasiCalendar()
$this->assertEquals(true, (boolean)$mime->hasiCalendar());
}

public function testIdna()
{
$fixture = file_get_contents(__DIR__ . '/fixtures/idna.eml');
$headers = Horde_Mime_Headers::parseHeaders($fixture);
foreach (array('from', 'to', 'cc') as $n) {
if ($header = $headers->getHeader($n)) {
$obj = new Horde_ActiveSync_Mime_Headers_Addresses($n, $header->full_value);
$headers->removeHeader($n);
$headers->addHeaderOb($obj);
}
}
$this->assertEquals('Subject: TT Belieferungsstart der Schulfrei-Exemplare =?utf-8?b?ZsO8cg==?=
das Schuljahr 2017/2018
Date: Fri, 1 Sep 2017 09:52:05 +0100
Message-ID: <CC5F7757CE6E614EB669EF841EE099F067CB1F@srvmbx01.moserholding.com.i>
MIME-Version: 1.0
Content-Type: multipart/alternative;
boundary="----=_NextPart_000_0674_01D36791.91B0D380"
from: Michael J Rubinsky <mrubinsk@horde.org>
to: Jan Schneider <jan@horde.org>
cc: direktion@-abc.at, direktion@nms.-nd.abc.de
', $headers->toString());
}


}
92 changes: 92 additions & 0 deletions test/Horde/ActiveSync/fixtures/idna.eml
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
From: "Michael J Rubinsky" <mrubinsk@horde.org>
To: "Jan Schneider" <jan@horde.org>
Cc: <direktion@-abc.at>,
<direktion@nms.-nd.abc.de>
Subject: =?iso-8859-1?Q?TT_Belieferungsstart_der_Schulfrei-Exemplare_f=FCr_das_Sch?=
=?iso-8859-1?Q?uljahr_2017/2018?=
Date: Fri, 1 Sep 2017 09:52:05 +0100
Message-ID: <CC5F7757CE6E614EB669EF841EE099F067CB1F@srvmbx01.moserholding.com.i>
MIME-Version: 1.0
Content-Type: multipart/alternative;
boundary="----=_NextPart_000_0674_01D36791.91B0D380"

This is a multipart message in MIME format.

------=_NextPart_000_0674_01D36791.91B0D380
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: 8bit
Foobar
------=_NextPart_000_0674_01D36791.91B0D380
Content-Type: text/html;
boundary="_000_CC5F7757CE6E614EB669EF841EE099F067CB1Fsrvmbx01moserhold_";
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<html xmlns:v=3D"urn:schemas-microsoft-com:vml" =
xmlns:o=3D"urn:schemas-microsoft-com:office:office" =
xmlns:w=3D"urn:schemas-microsoft-com:office:word" =
xmlns:m=3D"http://schemas.microsoft.com/office/2004/12/omml" =
xmlns=3D"http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv=3D"Content-Type" content=3D"text/html; =
charset=3Diso-8859-1">
<meta name=3D"Generator" content=3D"Microsoft Word 14 (filtered =
medium)">
<style><!--
/* Font Definitions */
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin-top:0cm;
margin-right:0cm;
margin-bottom:10.0pt;
margin-left:0cm;
line-height:115%;
font-size:11.0pt;
font-family:"Calibri","sans-serif";
mso-fareast-language:EN-US;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:purple;
text-decoration:underline;}
span.E-MailFormatvorlage17
{mso-style-type:personal-compose;
font-family:"Calibri","sans-serif";
color:windowtext;}
.MsoChpDefault
{mso-style-type:export-only;
font-family:"Calibri","sans-serif";
mso-fareast-language:EN-US;}
@page WordSection1
{size:612.0pt 792.0pt;
margin:70.85pt 70.85pt 2.0cm 70.85pt;}
div.WordSection1
{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext=3D"edit" spidmax=3D"1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext=3D"edit">
<o:idmap v:ext=3D"edit" data=3D"1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang=3D"DE" link=3D"blue" vlink=3D"purple">
<div class=3D"WordSection1">
<p class=3D"MsoNormal">FooBar<o:p></o:p></p>
</div>
</body>
</html>
------=_NextPart_000_0674_01D36791.91B0D380--

0 comments on commit 85f59f1

Please sign in to comment.