Skip to content

Commit d10c6df

Browse files
authored
Revert "[10.x] Fix custom themes not reseting on Markdown renderer (#46200)" (#46328)
This reverts commit c06dfac.
1 parent 3c5ae94 commit d10c6df

File tree

2 files changed

+3
-49
lines changed

2 files changed

+3
-49
lines changed

src/Illuminate/Mail/Mailable.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -324,7 +324,9 @@ protected function buildMarkdownView()
324324
{
325325
$markdown = Container::getInstance()->make(Markdown::class);
326326

327-
$markdown->theme($this->theme ?? 'default');
327+
if (isset($this->theme)) {
328+
$markdown->theme($this->theme);
329+
}
328330

329331
$data = $this->buildViewData();
330332

tests/Mail/MailMailableTest.php

Lines changed: 0 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,8 @@
77
use Illuminate\Contracts\View\Factory;
88
use Illuminate\Mail\Attachment;
99
use Illuminate\Mail\Mailable;
10-
use Illuminate\Mail\Mailables\Content;
1110
use Illuminate\Mail\Mailables\Envelope;
1211
use Illuminate\Mail\Mailer;
13-
use Illuminate\Mail\Markdown;
1412
use Illuminate\Mail\Transport\ArrayTransport;
1513
use Mockery as m;
1614
use PHPUnit\Framework\AssertionFailedError;
@@ -439,52 +437,6 @@ public function testMailableSetsFromCorrectly()
439437
}
440438
}
441439

442-
public function testMailableSetsMarkdownThemeCorrectly()
443-
{
444-
$viewFactory = m::mock(Factory::class);
445-
$viewFactory->shouldReceive('flushFinderCache');
446-
$viewFactory->shouldReceive('replaceNamespace')->andReturnSelf();
447-
$viewFactory->shouldReceive('make')->andReturnSelf();
448-
$viewFactory->shouldReceive('render')->andReturn('<html></html>', 'body {}');
449-
$viewFactory->shouldReceive('exists')->andReturn(true);
450-
451-
Container::getInstance()->instance(Factory::class, $viewFactory);
452-
Container::getInstance()->singleton(Markdown::class);
453-
Container::getInstance()->instance('mailer', new class
454-
{
455-
public function render()
456-
{
457-
//
458-
}
459-
});
460-
461-
(new class() extends Mailable
462-
{
463-
public $theme = 'custom-theme';
464-
465-
public function content()
466-
{
467-
return new Content(
468-
markdown: 'mail.markdown',
469-
);
470-
}
471-
})->render();
472-
473-
$this->assertEquals('custom-theme', Container::getInstance()->make(Markdown::class)->getTheme());
474-
475-
(new class() extends Mailable
476-
{
477-
public function content()
478-
{
479-
return new Content(
480-
markdown: 'mail.markdown',
481-
);
482-
}
483-
})->render();
484-
485-
$this->assertEquals('default', Container::getInstance()->make(Markdown::class)->getTheme());
486-
}
487-
488440
public function testMailableSetsSubjectCorrectly()
489441
{
490442
$mailable = new WelcomeMailableStub;

0 commit comments

Comments
 (0)