Skip to content

Commit 4fa9356

Browse files
committed
Merge branch '9.x'
2 parents bdf5725 + c1f5c9e commit 4fa9356

File tree

4 files changed

+43
-2
lines changed

4 files changed

+43
-2
lines changed

src/Illuminate/Mail/Mailable.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1664,6 +1664,10 @@ private function ensureContentIsHydrated()
16641664
$this->markdown($content->markdown);
16651665
}
16661666

1667+
if ($content->htmlString) {
1668+
$this->html($content->htmlString);
1669+
}
1670+
16671671
foreach ($content->with as $key => $value) {
16681672
$this->with($key, $value);
16691673
}

src/Illuminate/Mail/Mailables/Content.php

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,13 @@ class Content
3838
*/
3939
public $markdown;
4040

41+
/**
42+
* The pre-rendered HTML of the message.
43+
*
44+
* @var string|null
45+
*/
46+
public $htmlString;
47+
4148
/**
4249
* The message's view data.
4350
*
@@ -53,16 +60,18 @@ class Content
5360
* @param string|null $text
5461
* @param string|null $markdown
5562
* @param array $with
63+
* @param string|null $htmlString
5664
*
5765
* @named-arguments-supported
5866
*/
59-
public function __construct(string $view = null, string $html = null, string $text = null, $markdown = null, array $with = [])
67+
public function __construct(string $view = null, string $html = null, string $text = null, $markdown = null, array $with = [], string $htmlString = null)
6068
{
6169
$this->view = $view;
6270
$this->html = $html;
6371
$this->text = $text;
6472
$this->markdown = $markdown;
6573
$this->with = $with;
74+
$this->htmlString = $htmlString;
6675
}
6776

6877
/**
@@ -115,6 +124,19 @@ public function markdown(string $view)
115124
return $this;
116125
}
117126

127+
/**
128+
* Set the pre-rendered HTML for the message.
129+
*
130+
* @param string $html
131+
* @return $this
132+
*/
133+
public function htmlString(string $html)
134+
{
135+
$this->htmlString = $html;
136+
137+
return $this;
138+
}
139+
118140
/**
119141
* Add a piece of view data to the message.
120142
*

src/Illuminate/Testing/PendingCommand.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -419,6 +419,8 @@ private function createABufferedOutputMock()
419419

420420
foreach ($this->test->expectedOutputSubstrings as $i => $text) {
421421
$mock->shouldReceive('doWrite')
422+
->atLeast()
423+
->times(0)
422424
->withArgs(fn ($output) => str_contains($output, $text))
423425
->andReturnUsing(function () use ($i) {
424426
unset($this->test->expectedOutputSubstrings[$i]);
@@ -427,6 +429,8 @@ private function createABufferedOutputMock()
427429

428430
foreach ($this->test->unexpectedOutput as $output => $displayed) {
429431
$mock->shouldReceive('doWrite')
432+
->atLeast()
433+
->times(0)
430434
->ordered()
431435
->with($output, Mockery::any())
432436
->andReturnUsing(function () use ($output) {
@@ -436,6 +440,8 @@ private function createABufferedOutputMock()
436440

437441
foreach ($this->test->unexpectedOutputSubstrings as $text => $displayed) {
438442
$mock->shouldReceive('doWrite')
443+
->atLeast()
444+
->times(0)
439445
->withArgs(fn ($output) => str_contains($output, $text))
440446
->andReturnUsing(function () use ($text) {
441447
$this->test->unexpectedOutputSubstrings[$text] = true;

tests/Integration/Database/EloquentModelCustomCastingTest.php

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ protected function tearDown(): void
5959
}
6060

6161
/**
62-
* Tests...
62+
* @requires extension gmp
6363
*/
6464
public function testSavingCastedAttributesToDatabase()
6565
{
@@ -97,6 +97,9 @@ public function testSavingCastedAttributesToDatabase()
9797
$this->assertInstanceOf(GMP::class, $model->amount);
9898
}
9999

100+
/**
101+
* @requires extension gmp
102+
*/
100103
public function testInvalidArgumentExceptionOnInvalidValue()
101104
{
102105
/** @var \Illuminate\Tests\Integration\Database\CustomCasts $model */
@@ -115,6 +118,9 @@ public function testInvalidArgumentExceptionOnInvalidValue()
115118
$this->assertSame('address_line_two_value', $model->address->lineTwo);
116119
}
117120

121+
/**
122+
* @requires extension gmp
123+
*/
118124
public function testInvalidArgumentExceptionOnNull()
119125
{
120126
/** @var \Illuminate\Tests\Integration\Database\CustomCasts $model */
@@ -133,6 +139,9 @@ public function testInvalidArgumentExceptionOnNull()
133139
$this->assertSame('address_line_two_value', $model->address->lineTwo);
134140
}
135141

142+
/**
143+
* @requires extension gmp
144+
*/
136145
public function testModelsWithCustomCastsCanBeConvertedToArrays()
137146
{
138147
/** @var \Illuminate\Tests\Integration\Database\CustomCasts $model */

0 commit comments

Comments
 (0)