From bb7667cba8d4706435b8b4ea96fc67b73ca8973b Mon Sep 17 00:00:00 2001 From: BinotaLIU Date: Wed, 24 Jul 2019 06:59:27 +0800 Subject: [PATCH 1/2] set default value to null we don't need to set default theme value here. The default theme is take care in Illuminate\Mail\Markdown::__constractut. Leave it null as default so config('mail.markdown.theme') can take effect. --- src/Illuminate/Notifications/Messages/MailMessage.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Illuminate/Notifications/Messages/MailMessage.php b/src/Illuminate/Notifications/Messages/MailMessage.php index 5a53283e9b46..9b3bab2ae803 100644 --- a/src/Illuminate/Notifications/Messages/MailMessage.php +++ b/src/Illuminate/Notifications/Messages/MailMessage.php @@ -36,7 +36,7 @@ class MailMessage extends SimpleMessage implements Renderable * * @var string|null */ - public $theme = 'default'; + public $theme; /** * The "from" information for the message. From fb295069265d73cab38d5fac21e4bb271157fd5a Mon Sep 17 00:00:00 2001 From: BinotaLIU Date: Wed, 24 Jul 2019 07:10:40 +0800 Subject: [PATCH 2/2] fix tests, theme() no longger be called by default The default value of theme make the function no longger be called, it only called if it has value --- .../Notifications/SendingMailNotificationsTest.php | 4 ---- 1 file changed, 4 deletions(-) diff --git a/tests/Integration/Notifications/SendingMailNotificationsTest.php b/tests/Integration/Notifications/SendingMailNotificationsTest.php index 3cfd9142acee..2141a09ff4ff 100644 --- a/tests/Integration/Notifications/SendingMailNotificationsTest.php +++ b/tests/Integration/Notifications/SendingMailNotificationsTest.php @@ -74,7 +74,6 @@ public function test_mail_is_sent() 'email' => 'taylor@laravel.com', ]); - $this->markdown->shouldReceive('theme')->once()->andReturnSelf(); $this->markdown->shouldReceive('render')->once()->andReturn('htmlContent'); $this->markdown->shouldReceive('renderText')->once()->andReturn('textContent'); @@ -119,7 +118,6 @@ public function test_mail_is_sent_to_named_address() 'name' => 'Taylor Otwell', ]); - $this->markdown->shouldReceive('theme')->once()->andReturnSelf(); $this->markdown->shouldReceive('render')->once()->andReturn('htmlContent'); $this->markdown->shouldReceive('renderText')->once()->andReturn('textContent'); @@ -163,7 +161,6 @@ public function test_mail_is_sent_with_subject() 'email' => 'taylor@laravel.com', ]); - $this->markdown->shouldReceive('theme')->once()->andReturnSelf(); $this->markdown->shouldReceive('render')->once()->andReturn('htmlContent'); $this->markdown->shouldReceive('renderText')->once()->andReturn('textContent'); @@ -197,7 +194,6 @@ public function test_mail_is_sent_to_multiple_adresses() 'email' => 'taylor@laravel.com', ]); - $this->markdown->shouldReceive('theme')->once()->andReturnSelf(); $this->markdown->shouldReceive('render')->once()->andReturn('htmlContent'); $this->markdown->shouldReceive('renderText')->once()->andReturn('textContent');