I ran into the same problem after applying the kriswallsmith trend optimization trick . I could see the result of sending mail to the web profiler when starting the development version, but could not get the data in the test environment.
After applying Chris's trick, I noticed that the swiftmailer.mailer.default.plugin.messagelogger service was not registered in the container during the test, therefore the collect () method of the MessageDataCollector class did not register data for sending mail. This is why it was not possible to get information from the swiftmailer collector.
The solution is to not override the initializeContainer () method in AppKernel.php or override it, but make sure the messagelogger service is available for test cases sending emails.
source share