Debian Codegraph @

lib/3rdParty/composer/webklex/php-imap/tests/issues/Issue410Test.php

raw symbols SCIP
1 <?php
2 /*
3 * File: Issue410Test.php
4 * Category: -
5 * Author: M.Goldenbaum
6 * Created: 23.06.23 20:41
7 * Updated: -
8 *
9 * Description:
10 * -
11 */
12
13 namespace Tests\issues;
14
15 use PHPUnit\Framework\TestCase;
16 use Tests\fixtures\FixtureTestCase;
17 use Webklex\PHPIMAP\Attachment;
18 use Webklex\PHPIMAP\ClientManager;
19 use Webklex\PHPIMAP\Exceptions\AuthFailedException;
20 use Webklex\PHPIMAP\Exceptions\ConnectionFailedException;
21 use Webklex\PHPIMAP\Exceptions\ImapBadRequestException;
22 use Webklex\PHPIMAP\Exceptions\ImapServerErrorException;
23 use Webklex\PHPIMAP\Exceptions\InvalidMessageDateException;
24 use Webklex\PHPIMAP\Exceptions\MaskNotFoundException;
25 use Webklex\PHPIMAP\Exceptions\MessageContentFetchingException;
26 use Webklex\PHPIMAP\Exceptions\ResponseException;
27 use Webklex\PHPIMAP\Exceptions\RuntimeException;
28 use Webklex\PHPIMAP\Message;
29
30 class Issue410Test extends FixtureTestCase {
31
32 /**
33 * @throws RuntimeException
34 * @throws MessageContentFetchingException
35 * @throws ResponseException
36 * @throws ImapBadRequestException
37 * @throws InvalidMessageDateException
38 * @throws ConnectionFailedException
39 * @throws \ReflectionException
40 * @throws ImapServerErrorException
41 * @throws AuthFailedException
42 * @throws MaskNotFoundException
43 */
44 public function testIssueEmail() {
45 $message = $this->getFixture("issue-410.eml");
46
47 self::assertSame("☆第132号 「ガーデン&エクステリア」専門店のためのQ&Aサロン 【月刊エクステリア・ワーク】", (string)$message->subject);
48
49 $attachments = $message->getAttachments();
50
51 self::assertSame(1, $attachments->count());
52
53 $attachment = $attachments->first();
54 self::assertSame("☆第132号 「ガーデン&エクステリア」専門店のためのQ&Aサロン 【月刊エクステリア・ワーク】", $attachment->filename);
55 self::assertSame("☆第132号 「ガーデン&エクステリア」専門店のためのQ&Aサロン 【月刊エクステリア・ワーク】", $attachment->name);
56 }
57
58 /**
59 * @throws RuntimeException
60 * @throws MessageContentFetchingException
61 * @throws ResponseException
62 * @throws ImapBadRequestException
63 * @throws InvalidMessageDateException
64 * @throws ConnectionFailedException
65 * @throws \ReflectionException
66 * @throws ImapServerErrorException
67 * @throws AuthFailedException
68 * @throws MaskNotFoundException
69 */
70 public function testIssueEmailB() {
71 $message = $this->getFixture("issue-410b.eml");
72
73 self::assertSame("386 - 400021804 - 19., Heiligenstädter Straße 80 - 0819306 - Anfrage Vergabevorschlag", (string)$message->subject);
74
75 $attachments = $message->getAttachments();
76
77 self::assertSame(1, $attachments->count());
78
79 $attachment = $attachments->first();
80 self::assertSame("2021_Mängelliste_0819306.xlsx", $attachment->description);
81 self::assertSame("2021_Mängelliste_0819306.xlsx", $attachment->filename);
82 self::assertSame("2021_Mängelliste_0819306.xlsx", $attachment->name);
83 }
84
85 /**
86 * @throws RuntimeException
87 * @throws MessageContentFetchingException
88 * @throws ResponseException
89 * @throws ImapBadRequestException
90 * @throws ConnectionFailedException
91 * @throws InvalidMessageDateException
92 * @throws ImapServerErrorException
93 * @throws AuthFailedException
94 * @throws \ReflectionException
95 * @throws MaskNotFoundException
96 */
97 public function testIssueEmailSymbols() {
98 $message = $this->getFixture("issue-410symbols.eml");
99
100 $attachments = $message->getAttachments();
101
102 self::assertSame(1, $attachments->count());
103
104 /** @var Attachment $attachment */
105 $attachment = $attachments->first();
106 self::assertSame("Checkliste 10.,DAVIDGASSE 76-80;2;2.pdf", $attachment->description);
107 self::assertSame("Checkliste 10.,DAVIDGASSE 76-80;2;2.pdf", $attachment->name);
108 self::assertSame("Checkliste 10.,DAVIDGASSE 76-80;2;2.pdf", $attachment->filename);
109 }
110
111 }