Skip to content

Commit 814054e

Browse files
Revert "[11.x] Use Str::wrap() instead of nesting Str::start() inside Str::finish()" (#54528)
* test(mail): 🧪 Add failing test * fix(mail): 🐛 Make sure, already wrapped strings are not wrapped again * Update Headers.php --------- Co-authored-by: Taylor Otwell <[email protected]>
1 parent fbab686 commit 814054e

File tree

2 files changed

+28
-1
lines changed

2 files changed

+28
-1
lines changed

src/Illuminate/Mail/Mailables/Headers.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ public function text(array $text)
9595
public function referencesString(): string
9696
{
9797
return (new Collection($this->references))
98-
->map(fn ($messageId) => Str::wrap($messageId, '<', '>'))
98+
->map(fn ($messageId) => Str::of($messageId)->start('<')->finish('>')->value())
9999
->implode(' ');
100100
}
101101
}
+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
<?php
2+
3+
namespace Illuminate\Tests\Mail;
4+
5+
use Illuminate\Mail\Mailables\Headers;
6+
use PHPUnit\Framework\TestCase;
7+
8+
class MailMailableHeadersTest extends TestCase
9+
{
10+
public function test()
11+
{
12+
$headers = new Headers(
13+
14+
[
15+
16+
17+
18+
19+
],
20+
);
21+
22+
$this->assertSame(
23+
24+
$headers->referencesString(),
25+
);
26+
}
27+
}

0 commit comments

Comments
 (0)