From 44910ae2df4de4d7bae5fb6feafe02b465423da7 Mon Sep 17 00:00:00 2001 From: MarioRadu Date: Fri, 29 Nov 2024 12:52:44 +0200 Subject: [PATCH] fix failing test Signed-off-by: MarioRadu --- test/Unit/Contact/Service/MessageServiceTest.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/test/Unit/Contact/Service/MessageServiceTest.php b/test/Unit/Contact/Service/MessageServiceTest.php index fdc3ecb0..266d8920 100644 --- a/test/Unit/Contact/Service/MessageServiceTest.php +++ b/test/Unit/Contact/Service/MessageServiceTest.php @@ -4,6 +4,7 @@ namespace FrontendTest\Unit\Contact\Service; +use Dot\Mail\Email; use Dot\Mail\Exception\MailException; use Dot\Mail\Result\ResultInterface; use Dot\Mail\Service\MailServiceInterface; @@ -41,10 +42,12 @@ public function testProcessMessage(): void $mailService = $this->createMock(MailServiceInterface::class); $template = $this->createMock(TemplateRendererInterface::class); $result = $this->createMock(ResultInterface::class); + $mail = $this->createMock(Email::class); + $mail->expects($this->once())->method('addFrom')->willReturn($mail); $result->expects($this->once())->method('isValid')->willReturn(true); $mailService->expects($this->once())->method('send')->willReturn($result); - + $mailService->expects($this->any())->method('getMessage')->willReturn($mail); $service = new MessageService( $messageRepository, $mailService,