Skip to content

Commit

Permalink
Merge pull request #58 from RonasIT/add-test-for-field-email-from
Browse files Browse the repository at this point in the history
feat: add the ability to test the From field for email
  • Loading branch information
DenTray authored Feb 2, 2023
2 parents f342edc + 43ae9f4 commit 063354c
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions tests/TestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@ protected function assertSentCallback(array $emailChain, int &$index, bool $expo
$this->assertSubject($expectedMailData, $mail);
$this->assertEmailsList($expectedMailData, $mail, $index);
$this->assertFixture($expectedMailData, $mail, $exportMode);
$this->assertEmailFrom($expectedMailData, $mail);

$index++;

Expand Down Expand Up @@ -174,6 +175,15 @@ protected function assertSentToEmailsList(array $sentEmails, array $emails, int
}
}

protected function assertEmailFrom(array $currentMail, Mailable $mail): void
{
$expectedFrom = Arr::get($currentMail, 'from');

if (!empty($expectedFrom)) {
$mail->assertFrom($expectedFrom);
}
}

protected function assertCountMails(array $emailChain, int $index): void
{
$countData = count($emailChain);
Expand Down

0 comments on commit 063354c

Please sign in to comment.