Skip to content

Commit edf49a4

Browse files
committed
Update FileMessageTest.php
1 parent e3f203c commit edf49a4

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

tests/Unit/FileMessageTest.php

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
<?php
22

33
use DirectoryTree\ImapEngine\Attachment;
4+
use DirectoryTree\ImapEngine\Enums\ImapFlag;
45
use DirectoryTree\ImapEngine\Exceptions\RuntimeException;
56
use DirectoryTree\ImapEngine\FileMessage;
67

@@ -10,6 +11,24 @@
1011
$message->parse();
1112
})->throws(RuntimeException::class);
1213

14+
test('it throws exception when uid is called', function () {
15+
$message = new FileMessage('test');
16+
17+
$message->uid();
18+
})->throws(BadMethodCallException::class);
19+
20+
test('it throws exception when flag is called', function () {
21+
$message = new FileMessage('test');
22+
23+
$message->flag(ImapFlag::Seen, '+');
24+
})->throws(BadMethodCallException::class);
25+
26+
test('it returns empty flags', function () {
27+
$message = new FileMessage('test');
28+
29+
expect($message->flags())->toBe([]);
30+
});
31+
1332
test('it can parse a standard EML message and read basic headers', function () {
1433
$contents = <<<'EOT'
1534
From: "John Doe" <[email protected]>

0 commit comments

Comments
 (0)