Skip to content

Commit

Permalink
Add a test to ensure plain text email works
Browse files Browse the repository at this point in the history
  • Loading branch information
m1guelpf committed Jun 17, 2020
1 parent 9f21a97 commit 6537997
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/TestMail.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,17 @@

class TestMail extends Mailable
{
protected $plainText;

public function __construct($plainText = false)
{
$this->plainText = $plainText;
}

public function build()
{
return $this->subject("Test from HELO")
->markdown('helo::email');
$this->subject("Test from HELO");

return $this->plainText ? $this->text('helo::email') : $this->markdown('helo::email');
}
}
10 changes: 10 additions & 0 deletions tests/HeloTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,16 @@ public function test_the_mail_commands_sends_the_mailable()
Mail::assertSent(TestMail::class);
}

/** @test */
public function test_plain_text_mails_work_correctly()
{
Mail::fake();

Mail::to('[email protected]')->send(new TestMail(true));

Mail::assertSent(TestMail::class);
}

/** @test */
public function test_the_correct_mailer_is_binded()
{
Expand Down

0 comments on commit 6537997

Please sign in to comment.