From 18de950d8fcc29d5ff33a154dc14225a807225b9 Mon Sep 17 00:00:00 2001 From: Igor Scheller Date: Sun, 27 Oct 2019 12:32:28 +0100 Subject: Mail log: Formatting --- src/Mail/Transport/LogTransport.php | 4 ++-- tests/Unit/Mail/Transport/LogTransportTest.php | 5 +---- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/src/Mail/Transport/LogTransport.php b/src/Mail/Transport/LogTransport.php index 6e351302..632a6bc0 100644 --- a/src/Mail/Transport/LogTransport.php +++ b/src/Mail/Transport/LogTransport.php @@ -31,11 +31,11 @@ class LogTransport extends Transport &$failedRecipients = null ): int { $this->logger->debug( - 'Mail: Send mail "{title}" to "{recipients}":' . PHP_EOL . '{content}', + 'Mail: Send mail "{title}" to "{recipients}":' . PHP_EOL . PHP_EOL . '{content}', [ 'title' => $message->getSubject(), 'recipients' => $this->getTo($message), - 'content' => (string)$message->getHeaders() . PHP_EOL . PHP_EOL . $message->toString(), + 'content' => $message->toString(), ] ); diff --git a/tests/Unit/Mail/Transport/LogTransportTest.php b/tests/Unit/Mail/Transport/LogTransportTest.php index bf3ec5dc..bd51d30f 100644 --- a/tests/Unit/Mail/Transport/LogTransportTest.php +++ b/tests/Unit/Mail/Transport/LogTransportTest.php @@ -24,12 +24,9 @@ class LogTransportTest extends TestCase $message->expects($this->once()) ->method('getSubject') ->willReturn('Some subject'); - $message->expects($this->once()) - ->method('getHeaders') - ->willReturn('Head: er'); $message->expects($this->once()) ->method('toString') - ->willReturn('Message body'); + ->willReturn("Head: er\n\nMessage body"); $logger->expects($this->once()) ->method('debug') -- cgit v1.2.3-54-g00ecf