With Mailer, it appears not possible to retrieve the body of an email in a functional test. For example, with
$email = $this->getMailerMessage(0);
$body = $email->getBody();
var_dump($body);
$body
is revealed as
object(Symfony\Component\Mime\Part\Multipart\AlternativePart)...
There are no (apparent) accessible properties of that object. Is there any method for accessing the text of the body of an email sent with Symfony Mailer in a functional test?
With SwiftMailer one could retrieve the body of an email in a functional test with:
$mailCollector = $this->client->getProfile()->getCollector('swiftmailer');
$collectedMessages = $mailCollector->getMessages();
$message = $collectedMessages[0];
$body = $message->getBody();