Skip to content

Commit 45f9070

Browse files
Merge branch '6.1' into 6.2
* 6.1: (25 commits) [Messenger] Use :memory: for SQLite tests [Mailer] Stream timeout not detected due to checking only string result of function fgets don not set http_version instead of setting it to null [DependencyInjection] don't move locator tag for service subscriber Fix search scope when performing fallback mapping driver detection Fix the notification email theme for asynchronously dispatched emails Update the CI setup to use the new output file Update actions in the CI to move away from the deprecated runtime Use 6.3 for new features [HttpFoundation] Check IPv6 is valid before comparing it Run tests with UTC to avoid daylight saving time messing with assertions Bump Symfony version to 6.1.8 Update VERSION for 6.1.7 Update CHANGELOG for 6.1.7 Bump Symfony version to 6.0.16 Update VERSION for 6.0.15 Update CHANGELOG for 6.0.15 Bump Symfony version to 5.4.16 Update VERSION for 5.4.15 Update CHANGELOG for 5.4.15 ...
2 parents 96be740 + fb6ae75 commit 45f9070

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

Mime/NotificationEmail.php

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -225,15 +225,20 @@ private function getExceptionAsString(\Throwable|FlattenException $exception): s
225225
*/
226226
public function __serialize(): array
227227
{
228-
return [$this->context, parent::__serialize()];
228+
return [$this->context, $this->theme, parent::__serialize()];
229229
}
230230

231231
/**
232232
* @internal
233233
*/
234234
public function __unserialize(array $data): void
235235
{
236-
[$this->context, $parentData] = $data;
236+
if (3 === \count($data)) {
237+
[$this->context, $this->theme, $parentData] = $data;
238+
} else {
239+
// Backwards compatibility for deserializing data structures that were serialized without the theme
240+
[$this->context, $parentData] = $data;
241+
}
237242

238243
parent::__unserialize($parentData);
239244
}

Tests/Mime/NotificationEmailTest.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ public function testSerialize()
4747
->importance(NotificationEmail::IMPORTANCE_HIGH)
4848
->action('Bar', 'http://example.com/')
4949
->context(['a' => 'b'])
50+
->theme('example')
5051
));
5152
$this->assertEquals([
5253
'importance' => NotificationEmail::IMPORTANCE_HIGH,
@@ -59,6 +60,8 @@ public function testSerialize()
5960
'a' => 'b',
6061
'footer_text' => 'Notification e-mail sent by Symfony',
6162
], $email->getContext());
63+
64+
$this->assertSame('@email/example/notification/body.html.twig', $email->getHtmlTemplate());
6265
}
6366

6467
public function testTheme()

0 commit comments

Comments
 (0)