From 46d8a7333b9b77ccc440afd0a3c3fe7c5bc3901c Mon Sep 17 00:00:00 2001 From: Thomas Lehmann Date: Thu, 7 Nov 2024 11:02:17 +0100 Subject: feat(Mailer): implement caching Currently $this->instance is never set, so the code is no-op. This brings back caching of the instance. Caching broke with be7db1573dc8c6e7309ec9db124a7a74b8b41199 Swift to \Swift_Mailer as abstraction Signed-off-by: Thomas Lehmann --- tests/lib/Mail/MailerTest.php | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'tests') diff --git a/tests/lib/Mail/MailerTest.php b/tests/lib/Mail/MailerTest.php index f215e385e3f..84015f38d24 100644 --- a/tests/lib/Mail/MailerTest.php +++ b/tests/lib/Mail/MailerTest.php @@ -337,4 +337,10 @@ class MailerTest extends TestCase { self::assertInstanceOf(EsmtpTransport::class, $transport); self::assertEquals('[127.0.0.1]', $transport->getLocalDomain()); } + + public function testCaching(): void { + $symfonyMailer1 = self::invokePrivate($this->mailer, 'getInstance'); + $symfonyMailer2 = self::invokePrivate($this->mailer, 'getInstance'); + self::assertSame($symfonyMailer1, $symfonyMailer2); + } } -- cgit v1.2.3