Skip to content

Conversation

ThomasLandauer
Copy link
Member

Fixing seeEmailIsSent() for Symfony Mailer

How did I figure it out (=Symfony internals):
mailer_debug.php sends the MessageDataCollector to mailer.html.twig, which shows that the number of events.messages is the thing to look for.

I'm just adding this number to the number returned by the SwiftMailer Collector.

Limitations (=TODO):

  • I have both SwiftMailer and Symfony Mailer installed - don't know what happens if you only have one (or none)
  • I didn't add any tests - don't know how to do that

ThomasLandauer and others added 2 commits June 20, 2020 23:57
Fixing `seeEmailIsSent()` for [Symfony Mailer](https://symfony.com/doc/master/mailer.html)

How did I figure it out (=Symfony internals):
[`mailer_debug.php`](https://github.com/symfony/symfony/blob/master/src/Symfony/Bundle/FrameworkBundle/Resources/config/mailer_debug.php) sends the [`MessageDataCollector`](https://github.com/symfony/symfony/blob/master/src/Symfony/Component/Mailer/DataCollector/MessageDataCollector.php) to [`mailer.html.twig`](https://github.com/symfony/symfony/blob/master/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/mailer.html.twig#L9), which shows that the number of `events.messages` is the thing to look for.

I'm just adding this number to the number returned by the SwiftMailer Collector.

Limitations (=TODO):
* I have both SwiftMailer and Symfony Mailer installed - don't know what happens if you only have one (or none)
* I didn't add any tests - don't know how to do that
@Naktibalda Naktibalda merged commit 7a2ecf8 into Codeception:master Aug 28, 2020
@ThomasLandauer
Copy link
Member Author

@TavoNiievez Can I delete the branch ThomasLandauer:patch-1 or do you still need anything from there?

@ghost
Copy link

ghost commented Aug 28, 2020

you can safely delete it @ThomasLandauer , thanks :)

@ThomasLandauer ThomasLandauer deleted the patch-1 branch August 28, 2020 18:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants