Skip to content

Commit dc237ef

Browse files
committed
Test case for Webklex#382 added
1 parent 4bbcb4b commit dc237ef

File tree

2 files changed

+42
-0
lines changed

2 files changed

+42
-0
lines changed

tests/issues/Issue382Test.php

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
<?php
2+
/*
3+
* File: Issue382Test.php
4+
* Category: Test
5+
* Author: M.Goldenbaum
6+
* Created: 24.06.23 00:41
7+
* Updated: -
8+
*
9+
* Description:
10+
* -
11+
*/
12+
13+
namespace Tests\issues;
14+
15+
use PHPUnit\Framework\TestCase;
16+
use Webklex\PHPIMAP\Message;
17+
18+
class Issue382Test extends TestCase {
19+
20+
public function testIssueEmail() {
21+
$filename = implode(DIRECTORY_SEPARATOR, [__DIR__, "..", "messages", "issue-382.eml"]);
22+
$message = Message::fromFile($filename);
23+
24+
$from = $message->from->first();
25+
26+
self::assertSame("Mail Delivery System", $from->personal);
27+
self::assertSame("MAILER-DAEMON", $from->mailbox);
28+
self::assertSame("mta-09.someserver.com", $from->host);
29+
self::assertSame("[email protected]", $from->mail);
30+
self::assertSame("Mail Delivery System <[email protected]>", $from->full);
31+
}
32+
33+
}

tests/messages/issue-382.eml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
From: [email protected] (Mail Delivery System)
2+
3+
Subject: Test
4+
Date: Wed, 13 Sep 2017 13:05:45 +0200
5+
Content-Type: text/plain;
6+
charset="us-ascii"
7+
Content-Transfer-Encoding: quoted-printable
8+
9+
Hi

0 commit comments

Comments
 (0)