Skip to content

Commit 9d78587

Browse files
committed
Add failing test
1 parent 01ac9ed commit 9d78587

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

tests/Unit/FileMessageTest.php

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,24 @@
2929
expect($message->flags())->toBe([]);
3030
});
3131

32+
test('it handles invalid date header that returns null from getDateTime', function () {
33+
$contents = <<<'EOT'
34+
From: "John Doe" <[email protected]>
35+
To: "Jane Roe" <[email protected]>
36+
Subject: Test Subject
37+
Date: Invalid Date String
38+
Message-ID: <[email protected]>
39+
MIME-Version: 1.0
40+
Content-Type: text/plain; charset="UTF-8"
41+
42+
Hello World
43+
EOT;
44+
45+
$message = new FileMessage($contents);
46+
47+
expect($message->date())->toBeNull();
48+
});
49+
3250
test('it can parse a standard EML message and read basic headers', function () {
3351
$contents = <<<'EOT'
3452
From: "John Doe" <[email protected]>

0 commit comments

Comments
 (0)