Skip to content

Commit

Permalink
Merge pull request #12 from kirschbaum-development/htm-mail-body-fix
Browse files Browse the repository at this point in the history
Use HTML body when email is HTML for body assertions
  • Loading branch information
brandonferens authored Jun 14, 2022
2 parents 9d01187 + ef3ab6a commit fdc0529
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Assertions/ContentAssertions.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public function assertMailBodyContainsString(string $needle, AssertableMessage |

$this->{$method}(
$needle,
$mail->getBody()->bodyToString(),
$mail->getHtmlBody() ?: $mail->getBody()->bodyToString(),
"The expected [{$needle}] string was not found in the body."
);
}
Expand All @@ -40,7 +40,7 @@ public function assertMailBodyNotContainsString(string $needle, AssertableMessag

$this->{$method}(
$needle,
$mail->getBody()->bodyToString(),
$mail->getHtmlBody() ?: $mail->getBody()->bodyToString(),
"The expected [{$needle}] string was found in the body."
);
}
Expand Down

0 comments on commit fdc0529

Please sign in to comment.