Mail log: Formatting

main
Igor Scheller 5 years ago
parent 360a270161
commit 18de950d8f

@ -31,11 +31,11 @@ class LogTransport extends Transport
&$failedRecipients = null &$failedRecipients = null
): int { ): int {
$this->logger->debug( $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(), 'title' => $message->getSubject(),
'recipients' => $this->getTo($message), 'recipients' => $this->getTo($message),
'content' => (string)$message->getHeaders() . PHP_EOL . PHP_EOL . $message->toString(), 'content' => $message->toString(),
] ]
); );

@ -24,12 +24,9 @@ class LogTransportTest extends TestCase
$message->expects($this->once()) $message->expects($this->once())
->method('getSubject') ->method('getSubject')
->willReturn('Some subject'); ->willReturn('Some subject');
$message->expects($this->once())
->method('getHeaders')
->willReturn('Head: er');
$message->expects($this->once()) $message->expects($this->once())
->method('toString') ->method('toString')
->willReturn('Message body'); ->willReturn("Head: er\n\nMessage body");
$logger->expects($this->once()) $logger->expects($this->once())
->method('debug') ->method('debug')

Loading…
Cancel
Save