Skip to content

Commit 7bd184e

Browse files
committed
add test with saved mail from Mail\Message
1 parent 671e710 commit 7bd184e

File tree

2 files changed

+23
-2
lines changed

2 files changed

+23
-2
lines changed

tests/Mail/MimeDecodeTest.php

+10-2
Original file line numberDiff line numberDiff line change
@@ -144,11 +144,11 @@ public function testHeaders()
144144
public function testBuildMail()
145145
{
146146
$issue_id = null;
147-
$from = 'root@localhost';
147+
$from = 'Elan Ruusamäe <root@localhost>';
148148
$to = '';
149149
$cc = '';
150150
$subject = 'söme messidž';
151-
$body = "Hello, bödi tekst\n\nBye\n";
151+
$body = "Hello, bödi tekst\n\nBye";
152152
$in_reply_to = '';
153153
$iaf_ids = [];
154154

@@ -159,6 +159,14 @@ public function testBuildMail()
159159
$this->assertEquals($body, $mail->getMessageBody());
160160
}
161161

162+
public function testBuildMailSave()
163+
{
164+
// this is mail saved by Support::buildMail
165+
$content = $this->readDataFile('saved_mail.txt');
166+
$mail = MailMessage::createFromString($content);
167+
$this->assertNotEmpty($mail);
168+
}
169+
162170
/**
163171
* Hack out inconsistencies:
164172
*

tests/data/saved_mail.txt

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
Message-ID: <eventum.md5.5bhio6s4d.3b93g4mym7i88@localhost>
2+
From: =?UTF-8?Q?Elan=20Ruusam=C3=A4e?= <[email protected]>
3+
Subject: Issue closed comments
4+
MIME-Version: 1.0
5+
Content-Type: text/plain;
6+
charset="UTF-8"
7+
Content-Transfer-Encoding: 8bit
8+
Date: Thu, 20 Jul 2017 16:42:46 GMT
9+
In-Reply-To: <eventum.md5.5aqn97szv.1kwgvag1svvir@localhost>
10+
11+
suulle sulle
12+
13+
vill.

0 commit comments

Comments
 (0)