From 510c4eaf1074140e92931d77285be890de02d1f0 Mon Sep 17 00:00:00 2001 From: webklex Date: Tue, 27 Jun 2023 01:51:59 +0200 Subject: [PATCH] Test case extended to include attachment filename decoding #410 --- tests/issues/Issue410Test.php | 8 ++++++++ tests/messages/issue-410.eml | 15 +++++++++++---- 2 files changed, 19 insertions(+), 4 deletions(-) diff --git a/tests/issues/Issue410Test.php b/tests/issues/Issue410Test.php index 7c3e6dc..068cb7d 100644 --- a/tests/issues/Issue410Test.php +++ b/tests/issues/Issue410Test.php @@ -22,6 +22,14 @@ public function testIssueEmail() { $message = Message::fromFile($filename); self::assertSame("☆第132号 「ガーデン&エクステリア」専門店のためのQ&Aサロン 【月刊エクステリア・ワーク】", (string)$message->subject); + + $attachments = $message->getAttachments(); + + self::assertSame(1, $attachments->count()); + + $attachment = $attachments->first(); + self::assertSame("☆第132号 「ガーデン&エクステリア」専門店のためのQ&Aサロン 【月刊エクステリア・ワーク】", $attachment->filename); + self::assertSame("☆第132号 「ガーデン&エクステリア」専門店のためのQ&Aサロン 【月刊エクステリア・ワーク】", $attachment->name); } } \ No newline at end of file diff --git a/tests/messages/issue-410.eml b/tests/messages/issue-410.eml index 05ddeff..e5fe0c6 100644 --- a/tests/messages/issue-410.eml +++ b/tests/messages/issue-410.eml @@ -2,8 +2,15 @@ From: from@there.com To: to@here.com Subject: =?ISO-2022-JP?B?GyRCIXlCaBsoQjEzMhskQjlmISEhViUsITwlRyVzGyhCJhskQiUoJS8lOSVGJWolIiFXQGxMZ0U5JE4kPyRhJE4jURsoQiYbJEIjQSU1JW0lcyEhIVo3bjQpJSglLyU5JUYlaiUiISYlbyE8JS8hWxsoQg==?= Date: Wed, 13 Sep 2017 13:05:45 +0200 -Content-Type: text/plain; - charset="us-ascii" -Content-Transfer-Encoding: quoted-printable +MIME-Version: 1.0 +Content-Type: multipart/mixed; + boundary="------------B832AF745285AEEC6D5AEE42" -Hi \ No newline at end of file +Hi +--------------B832AF745285AEEC6D5AEE42 +Content-Transfer-Encoding: base64 +Content-Disposition: attachment; + filename="=?ISO-2022-JP?B?GyRCIXlCaBsoQjEzMhskQjlmISEhViUsITwlRyVzGyhCJhskQiUoJS8lOSVGJWolIiFXQGxMZ0U5JE4kPyRhJE4jURsoQiYbJEIjQSU1JW0lcyEhIVo3bjQpJSglLyU5JUYlaiUiISYlbyE8JS8hWxsoQg==?=" + +SGkh +--------------B832AF745285AEEC6D5AEE42-- \ No newline at end of file