Debian Codegraph @

lib/3rdParty/composer/webklex/php-imap/tests/fixtures/EmailAddressTest.php

raw symbols SCIP
1 <?php
2 /*
3 * File: EmailAddressTest.php
4 * Category: -
5 * Author: M.Goldenbaum
6 * Created: 09.03.23 02:24
7 * Updated: -
8 *
9 * Description:
10 * -
11 */
12
13 namespace Tests\fixtures;
14
15 use Webklex\PHPIMAP\Exceptions\AuthFailedException;
16 use Webklex\PHPIMAP\Exceptions\ConnectionFailedException;
17 use Webklex\PHPIMAP\Exceptions\ImapBadRequestException;
18 use Webklex\PHPIMAP\Exceptions\ImapServerErrorException;
19 use Webklex\PHPIMAP\Exceptions\InvalidMessageDateException;
20 use Webklex\PHPIMAP\Exceptions\MaskNotFoundException;
21 use Webklex\PHPIMAP\Exceptions\MessageContentFetchingException;
22 use Webklex\PHPIMAP\Exceptions\ResponseException;
23 use Webklex\PHPIMAP\Exceptions\RuntimeException;
24
25 /**
26 * Class EmailAddressTest
27 *
28 * @package Tests\fixtures
29 */
30 class EmailAddressTest extends FixtureTestCase {
31
32 /**
33 * Test the fixture email_address.eml
34 *
35 * @return void
36 * @throws \ReflectionException
37 * @throws AuthFailedException
38 * @throws ConnectionFailedException
39 * @throws ImapBadRequestException
40 * @throws ImapServerErrorException
41 * @throws InvalidMessageDateException
42 * @throws MaskNotFoundException
43 * @throws MessageContentFetchingException
44 * @throws ResponseException
45 * @throws RuntimeException
46 */
47 public function testFixture() : void {
48 $message = $this->getFixture("email_address.eml");
49
50 self::assertEquals("", $message->subject);
51 self::assertEquals("[email protected]", $message->message_id);
52 self::assertEquals("Hi\r\nHow are you?", $message->getTextBody());
53 self::assertFalse($message->hasHTMLBody());
54 self::assertFalse($message->date->first());
55 self::assertEquals("no_host", (string)$message->from);
56 self::assertEquals("", $message->to);
57 self::assertEquals("This one: is \"right\" <[email protected]>, No-address", (string)$message->cc);
58 }
59 }