Debian Codegraph @

lib/3rdParty/composer/webklex/php-imap/tests/issues/Issue544Test.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 Issue544Test 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-544.eml");
46
47 self::assertSame("Test bad boundary", (string)$message->subject);
48
49 $attachments = $message->getAttachments();
50
51 self::assertSame(1, $attachments->count());
52
53 /** @var Attachment $attachment */
54 $attachment = $attachments->first();
55 self::assertSame("file.pdf", $attachment->name);
56 self::assertSame("file.pdf", $attachment->filename);
57 self::assertStringStartsWith("%PDF-1.4", $attachment->content);
58 self::assertStringEndsWith("%%EOF\n", $attachment->content);
59 self::assertSame(14938, $attachment->size);
60 }
61 }