Closed
Description
Description
When testing, the NullTransport
in mailer is an attractive thing to use... because it completely disables delivery. But, if it stored the messages that were sent to it, then, in functional tests, we could easily fetch the transport from the container and verify its contents. This is what we do for the similar InMemoruyTransport
in Messenger (https://github.com/symfony/symfony/blob/4.4/src/Symfony/Component/Messenger/Transport/InMemoryTransport.php).
Another option would be to add info to the profiler and use that. I'm not sure which is better - it's always felt a bit awkward to need to enable the profiler whenever I needed to check if emails were sent, but that is also its job...
Relates to #31592