Skip to content

Commit fb6ae75

Browse files
Merge branch '6.0' into 6.1
* 6.0: (22 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.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 Bump Symfony version to 4.4.49 Update VERSION for 4.4.48 Update CONTRIBUTORS for 4.4.48 ...
2 parents 10f4ccb + 5a0b963 commit fb6ae75

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
@@ -224,15 +224,20 @@ private function getExceptionAsString(\Throwable|FlattenException $exception): s
224224
*/
225225
public function __serialize(): array
226226
{
227-
return [$this->context, parent::__serialize()];
227+
return [$this->context, $this->theme, parent::__serialize()];
228228
}
229229

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

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

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)