|
13 | 13 | namespace Tests\issues;
|
14 | 14 |
|
15 | 15 | use PHPUnit\Framework\TestCase;
|
| 16 | +use Tests\live\LiveMailboxTestCase; |
| 17 | +use Webklex\PHPIMAP\Folder; |
16 | 18 | use Webklex\PHPIMAP\Message;
|
17 | 19 |
|
18 |
| -class Issue413Test extends TestCase { |
| 20 | +class Issue413Test extends LiveMailboxTestCase { |
19 | 21 |
|
| 22 | + /** |
| 23 | + * Live server test |
| 24 | + * |
| 25 | + * @return void |
| 26 | + * @throws \Webklex\PHPIMAP\Exceptions\AuthFailedException |
| 27 | + * @throws \Webklex\PHPIMAP\Exceptions\ConnectionFailedException |
| 28 | + * @throws \Webklex\PHPIMAP\Exceptions\EventNotFoundException |
| 29 | + * @throws \Webklex\PHPIMAP\Exceptions\FolderFetchingException |
| 30 | + * @throws \Webklex\PHPIMAP\Exceptions\GetMessagesFailedException |
| 31 | + * @throws \Webklex\PHPIMAP\Exceptions\ImapBadRequestException |
| 32 | + * @throws \Webklex\PHPIMAP\Exceptions\ImapServerErrorException |
| 33 | + * @throws \Webklex\PHPIMAP\Exceptions\InvalidMessageDateException |
| 34 | + * @throws \Webklex\PHPIMAP\Exceptions\MaskNotFoundException |
| 35 | + * @throws \Webklex\PHPIMAP\Exceptions\MessageContentFetchingException |
| 36 | + * @throws \Webklex\PHPIMAP\Exceptions\MessageFlagException |
| 37 | + * @throws \Webklex\PHPIMAP\Exceptions\MessageHeaderFetchingException |
| 38 | + * @throws \Webklex\PHPIMAP\Exceptions\MessageNotFoundException |
| 39 | + * @throws \Webklex\PHPIMAP\Exceptions\ResponseException |
| 40 | + * @throws \Webklex\PHPIMAP\Exceptions\RuntimeException |
| 41 | + */ |
| 42 | + public function testLiveIssueEmail() { |
| 43 | + $folder = $this->getFolder('INBOX'); |
| 44 | + self::assertInstanceOf(Folder::class, $folder); |
| 45 | + |
| 46 | + $_message = $this->appendMessageTemplate($folder, 'issue-413.eml'); |
| 47 | + |
| 48 | + $message = $folder->messages()->all()->get()->last(); |
| 49 | + self::assertEquals($message->uid, $_message->uid); |
| 50 | + |
| 51 | + self::assertSame("Test Message", (string)$message->subject); |
| 52 | + self::assertSame("This is just a test, so ignore it (if you can!)\r\n\r\nTony Marston", $message->getTextBody()); |
| 53 | + |
| 54 | + $message->delete(); |
| 55 | + } |
| 56 | + |
| 57 | + /** |
| 58 | + * Static parsing test |
| 59 | + * |
| 60 | + * @return void |
| 61 | + * @throws \ReflectionException |
| 62 | + * @throws \Webklex\PHPIMAP\Exceptions\AuthFailedException |
| 63 | + * @throws \Webklex\PHPIMAP\Exceptions\ConnectionFailedException |
| 64 | + * @throws \Webklex\PHPIMAP\Exceptions\ImapBadRequestException |
| 65 | + * @throws \Webklex\PHPIMAP\Exceptions\ImapServerErrorException |
| 66 | + * @throws \Webklex\PHPIMAP\Exceptions\InvalidMessageDateException |
| 67 | + * @throws \Webklex\PHPIMAP\Exceptions\MaskNotFoundException |
| 68 | + * @throws \Webklex\PHPIMAP\Exceptions\MessageContentFetchingException |
| 69 | + * @throws \Webklex\PHPIMAP\Exceptions\ResponseException |
| 70 | + * @throws \Webklex\PHPIMAP\Exceptions\RuntimeException |
| 71 | + */ |
20 | 72 | public function testIssueEmail() {
|
21 | 73 | $filename = implode(DIRECTORY_SEPARATOR, [__DIR__, "..", "messages", "issue-413.eml"]);
|
22 | 74 | $message = Message::fromFile($filename);
|
|
0 commit comments