Skip to content

Commit 93a02c7

Browse files
committed
wip
1 parent 9738a78 commit 93a02c7

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

packages/mailer/src/Testing/SentTestingEmail.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -247,6 +247,12 @@ public function assertSeeInHtml(string $expect): self
247247
*/
248248
public function assertNotSeeInHtml(string $expect): self
249249
{
250+
if ($this->symfonyEmail->getHtmlBody() === null) {
251+
Assert::assertNull($this->symfonyEmail->getHtmlBody());
252+
253+
return $this;
254+
}
255+
250256
Assert::assertStringNotContainsString(
251257
needle: $expect,
252258
haystack: $this->symfonyEmail->getHtmlBody(),
@@ -280,6 +286,12 @@ public function assertSeeInText(string $expect): self
280286
*/
281287
public function assertNotSeeInText(string $expect): self
282288
{
289+
if ($this->symfonyEmail->getTextBody() === null) {
290+
Assert::assertNull($this->symfonyEmail->getTextBody());
291+
292+
return $this;
293+
}
294+
283295
Assert::assertStringNotContainsString(
284296
needle: $expect,
285297
haystack: $this->symfonyEmail->getTextBody(),

tests/Integration/Mailer/SentEmailTest.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@ public function test_sent_email_assertions(): void
3131
$sent->assertSee('Hello Jon');
3232
$sent->assertNotSee('this is not in the email');
3333

34+
$sent->assertNotSeeInHtml('Hello Jon');
35+
3436
$sent->assertSeeInText('Hello Jon in Text');
3537
$sent->assertNotSeeInText('this is not in the Text');
3638

0 commit comments

Comments
 (0)