Skip to content

Commit

Permalink
bugfix
Browse files Browse the repository at this point in the history
  • Loading branch information
arukompas committed Aug 25, 2023
1 parent 9cf221b commit fe858eb
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/Message.php
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ public function getTextPart(): ?MessagePart
*/
public function getAttachments(): array
{
return array_filter($this->parts, fn ($part) => $part->isAttachment());
return array_values(array_filter($this->parts, fn ($part) => $part->isAttachment()));
}

public function getSize(): int
Expand Down
3 changes: 2 additions & 1 deletion tests/Unit/MessageTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,8 @@
->and($attachmentPart->getFilename())->toBe('test.txt');

$attachments = $message->getAttachments();
expect($attachments)->toHaveCount(1);
expect($attachments)->toHaveCount(1)
->and($attachments)->toHaveKey(0);
});

it('skips initial content that is not part of the message', function () {
Expand Down

0 comments on commit fe858eb

Please sign in to comment.