Skip to content

Commit

Permalink
Use HTML body when email is HTML for body assertions
Browse files Browse the repository at this point in the history
  • Loading branch information
therobfonz committed Jun 14, 2022
1 parent 9d01187 commit ef3ab6a
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 ef3ab6a

Please sign in to comment.