Skip to content

Commit e96998d

Browse files
Merge branch '7.3' into 7.4
* 7.3: [Filesystem] Unify logic for isAbsolute() in Path [Twig] Ensure WrappedTemplatedEmail::getReturnPath() returns a string [Console] Add missing VERBOSITY_SILENT case in CommandDataCollector [HttpClient] Reject 3xx pushed responses [ProxyManagerBridge] Remove comment that reference github discussion [ErrorHandler] Improve PHPDoc precision in SerializerErrorRenderer [Routing] Fix matching the "0" URL [Form] Fix EnumType choice_label logic for grouped choices The BrowserKit history with parameter separator without slash.
2 parents 394bb14 + d1aaec8 commit e96998d

File tree

2 files changed

+20
-1
lines changed

2 files changed

+20
-1
lines changed

Mime/WrappedTemplatedEmail.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ public function setReturnPath(string $address): static
9292

9393
public function getReturnPath(): string
9494
{
95-
return $this->message->getReturnPath();
95+
return $this->message->getReturnPath()?->toString() ?? '';
9696
}
9797

9898
/**

Tests/Mime/WrappedTemplatedEmailTest.php

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
use PHPUnit\Framework\TestCase;
1515
use Symfony\Bridge\Twig\Mime\BodyRenderer;
1616
use Symfony\Bridge\Twig\Mime\TemplatedEmail;
17+
use Symfony\Bridge\Twig\Mime\WrappedTemplatedEmail;
1718
use Twig\Environment;
1819
use Twig\Loader\FilesystemLoader;
1920

@@ -99,4 +100,22 @@ private function buildEmail(string $template): TemplatedEmail
99100

100101
return $email;
101102
}
103+
104+
public function testGetReturnPathWhenNull()
105+
{
106+
$twig = $this->createMock(Environment::class);
107+
$message = new TemplatedEmail();
108+
$email = new WrappedTemplatedEmail($twig, $message);
109+
110+
$this->assertSame('', $email->getReturnPath());
111+
}
112+
113+
public function testGetReturnPathWhenSet()
114+
{
115+
$twig = $this->createMock(Environment::class);
116+
$message = (new TemplatedEmail())->returnPath('[email protected]');
117+
$email = new WrappedTemplatedEmail($twig, $message);
118+
119+
$this->assertSame('[email protected]', $email->getReturnPath());
120+
}
102121
}

0 commit comments

Comments
 (0)