[otrs-cvs] otrs/scripts/test/SMIME EmailHandling.t,1.6,1.7
"CVS commits notifications of OTRS.org" <[email protected]>
| Newsgroups | gmane.comp.otrs.cvs |
|---|---|
| Message-ID | <[email protected]> |
Comments:
Update of /home/cvs/otrs/scripts/test/SMIME
In directory lancelot:/tmp/cvs-serv13461/scripts/test/SMIME
Modified Files:
EmailHandling.t
Log Message:
Added test with HTML content in 'text/html' MimeType.
Author: cr
Index: EmailHandling.t
===================================================================
RCS file: /home/cvs/otrs/scripts/test/SMIME/EmailHandling.t,v
retrieving revision 1.6
retrieving revision 1.7
diff -2 -u -d -r1.6 -r1.7
--- EmailHandling.t 20 Nov 2012 16:12:09 -0000 1.6
+++ EmailHandling.t 8 Feb 2013 14:48:13 -0000 1.7
@@ -1,5 +1,5 @@
# --
# EmailHandling.t - SMIME email handling tests
-# Copyright (C) 2001-2012 OTRS AG, http://otrs.org/
+# Copyright (C) 2001-2013 OTRS AG, http://otrs.org/
# --
# $Id$
@@ -25,4 +25,5 @@
use Kernel::Output::HTML::Layout;
use Kernel::Output::HTML::ArticleCheckSMIME;
+use Kernel::System::HTMLUtils;
# create local objects
@@ -155,4 +156,10 @@
);
+my $HTMLUtilsObject = Kernel::System::HTMLUtils->new(
+ %{$Self},
+ MainObject => $MainObject,
+ ConfigObject => $Self->{ConfigObject},
+);
+
#
# Setup environment
@@ -282,5 +289,6 @@
Name => 'simple string',
ArticleData => {
- Body => 'Simple string',
+ Body => 'Simple string',
+ MimeType => 'text/plain',
},
},
@@ -288,5 +296,6 @@
Name => 'simple string with unix newline',
ArticleData => {
- Body => 'Simple string \n with unix newline',
+ Body => 'Simple string \n with unix newline',
+ MimeType => 'text/plain',
},
},
@@ -294,5 +303,6 @@
Name => 'simple string with windows newline',
ArticleData => {
- Body => 'Simple string \r\n with windows newline',
+ Body => 'Simple string \r\n with windows newline',
+ MimeType => 'text/plain',
},
},
@@ -302,4 +312,5 @@
Body =>
'SimpleStringSimpleStringSimpleStringSimpleStringSimpleStringSimpleStringSimpleStringSimpleStringSimpleStringSimpleStringSimpleStringSimpleStringSimpleStringSimpleStringSimpleStringSimpleStringSimpleStringSimpleString',
+ MimeType => 'text/plain',
},
},
@@ -309,4 +320,5 @@
Body =>
'Simple string Simple string Simple string Simple string Simple string Simple string Simple string Simple string Simple string Simple string Simple string Simple string Simple string Simple string Simple string Simple string',
+ MimeType => 'text/plain',
},
},
@@ -314,5 +326,14 @@
Name => 'simple string with unicode data',
ArticleData => {
- Body => 'äöüßø@«∑€©ƒ',
+ Body => 'äöüßø@«∑€©ƒ',
+ MimeType => 'text/plain',
+ },
+ },
+ {
+ Name => 'Multiline HTML',
+ ArticleData => {
+ Body =>
+ '<!DOCTYPE html><html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"/></head><body style="font-family:Geneva,Helvetica,Arial,sans-serif; font-size: 12px;">Simple Line<br/><br/><br/>Your Ticket-Team<br/><br/>Your Agent<br/><br/>--<br/> Super Support - Waterford Business Park<br/> 5201 Blue Lagoon Drive - 8th Floor & 9th Floor - Miami, 33126 USA<br/> Email: [email protected] - Web: <a href="http://www.example.com/" title="http://www.example.com/" target="_blank">http://www.example.com/</a><br/>--</body></html>',
+ MimeType => 'text/html',
},
},
@@ -444,5 +465,5 @@
Subject => 'Unittest data',
Charset => 'utf-8',
- MimeType => 'text/plain', # "text/plain" or "text/html"
+ MimeType => $Test->{ArticleData}->{MimeType}, # "text/plain" or "text/html"
Body => 'Some nice text\n.',
Sign => {
@@ -506,7 +527,16 @@
);
+ my $TestBody = $Test->{ArticleData}->{Body};
+
+ # convert test body to ASCII if it was HTML
+ if ( $Test->{ArticleData}->{MimeType} eq 'text/html' ) {
+ $TestBody = $HTMLUtilsObject->ToAscii(
+ String => $TestBody,
+ );
+ }
+
$Self->Is(
$FinalArticleData{Body},
- $Test->{ArticleData}->{Body},
+ $TestBody,
"$Test->{Name} - verified body content",
);
---------------------------------------------------------------------
OTRS mailing list: cvs-log - Webpage: http://otrs.org/
Archive: http://lists.otrs.org/pipermail/cvs-log
To unsubscribe: http://lists.otrs.org/cgi-bin/listinfo/cvs-log