From 57e7d287ab4239295b50138eea2c2edeabc59539 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adrian=20N=C3=BCrnberger?= Date: Wed, 28 Jun 2023 03:42:20 +0200 Subject: [PATCH] add failing test (#421) --- tests/issues/Issue410Test.php | 16 ++++++++++++++++ tests/messages/issue-410b.eml | 22 ++++++++++++++++++++++ 2 files changed, 38 insertions(+) create mode 100644 tests/messages/issue-410b.eml diff --git a/tests/issues/Issue410Test.php b/tests/issues/Issue410Test.php index 068cb7d..b300ec7 100644 --- a/tests/issues/Issue410Test.php +++ b/tests/issues/Issue410Test.php @@ -13,6 +13,7 @@ namespace Tests\issues; use PHPUnit\Framework\TestCase; +use Webklex\PHPIMAP\ClientManager; use Webklex\PHPIMAP\Message; class Issue410Test extends TestCase { @@ -32,4 +33,19 @@ public function testIssueEmail() { self::assertSame("☆第132号 「ガーデン&エクステリア」専門店のためのQ&Aサロン 【月刊エクステリア・ワーク】", $attachment->name); } + public function testIssueEmailB() { + $filename = implode(DIRECTORY_SEPARATOR, [__DIR__, "..", "messages", "issue-410b.eml"]); + $message = Message::fromFile($filename); + + self::assertSame("386 - 400021804 - 19., Heiligenstädter Straße 80 - 0819306 - Anfrage Vergabevorschlag", (string)$message->subject); + + $attachments = $message->getAttachments(); + + self::assertSame(1, $attachments->count()); + + $attachment = $attachments->first(); + self::assertSame("2021_Mängelliste_0819306.xlsx", $attachment->filename); + self::assertSame("2021_Mängelliste_0819306.xlsx", $attachment->name); + } + } \ No newline at end of file diff --git a/tests/messages/issue-410b.eml b/tests/messages/issue-410b.eml new file mode 100644 index 0000000..b260a1e --- /dev/null +++ b/tests/messages/issue-410b.eml @@ -0,0 +1,22 @@ +From: from@there.com +To: to@here.com +Subject: =?iso-8859-1?Q?386_-_400021804_-_19.,_Heiligenst=E4dter_Stra=DFe_80_-_081?= + =?iso-8859-1?Q?9306_-_Anfrage_Vergabevorschlag?= +Date: Wed, 13 Sep 2017 13:05:45 +0200 +MIME-Version: 1.0 +Content-Type: multipart/mixed; + boundary="------------B832AF745285AEEC6D5AEE42" + +Hi +--------------B832AF745285AEEC6D5AEE42 +Content-Type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet; + name="=?iso-8859-1?Q?2021=5FM=E4ngelliste=5F0819306.xlsx?=" +Content-Description: =?iso-8859-1?Q?2021=5FM=E4ngelliste=5F0819306.xlsx?= +Content-Disposition: attachment; + filename="=?iso-8859-1?Q?2021=5FM=E4ngelliste=5F0819306.xlsx?="; size=11641; + creation-date="Mon, 10 Jan 2022 09:01:00 GMT"; + modification-date="Mon, 10 Jan 2022 09:01:00 GMT" +Content-Transfer-Encoding: base64 + +SGkh +--------------B832AF745285AEEC6D5AEE42-- \ No newline at end of file