File tree Expand file tree Collapse file tree 2 files changed +20
-2
lines changed Expand file tree Collapse file tree 2 files changed +20
-2
lines changed Original file line number Diff line number Diff line change 66
77class TestMail extends Mailable
88{
9+ protected $ plainText ;
10+
11+ public function __construct ($ plainText = false )
12+ {
13+ $ this ->plainText = $ plainText ;
14+ }
15+
916 public function build ()
1017 {
11- return $ this ->subject ("Test from HELO " )
12- ->markdown ('helo::email ' );
18+ $ this ->subject ("Test from HELO " );
19+
20+ return $ this ->plainText ? $ this ->text ('helo::email ' ) : $ this ->markdown ('helo::email ' );
1321 }
1422}
Original file line number Diff line number Diff line change @@ -29,6 +29,16 @@ public function test_the_mail_commands_sends_the_mailable()
2929 Mail::assertSent (TestMail::class);
3030 }
3131
32+ /** @test */
33+ public function test_plain_text_mails_work_correctly ()
34+ {
35+ Mail::fake ();
36+
37+ Mail::to ('test@usehelo.com ' )->send (new TestMail (true ));
38+
39+ Mail::assertSent (TestMail::class);
40+ }
41+
3242 /** @test */
3343 public function test_the_correct_mailer_is_binded ()
3444 {
You can’t perform that action at this time.
0 commit comments