Skip to content

Refactor email assertions #101

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jan 17, 2021
Merged

Refactor email assertions #101

merged 2 commits into from
Jan 17, 2021

Conversation

TavoNiievez
Copy link
Member

@TavoNiievez TavoNiievez commented Jan 14, 2021

In this PR:

  • Support for Swift Mailer is removed.
  • The mailer: config parameter is removed since it is no longer needed.
  • Now it is possible to assert emails sent from Symfony commands.
  • The Profiler is replaced by Mail Logger to do the email assertions since the profiler requires 'requests' to be made and that is not always a requirement to send emails in Symfony.

The fewest possible changes were made to the API to make it easier for users to upgrade to version 2.

The most significant change, however, is that seeEmailIsSent now defaults to 1 instead of null. This change is made because previously an assert of type assertGreatherThan was made, whereas now, the EmailCount Constraint requires that the expected number of emails be specified.

Checking the exact amount of emails sent is probably what you want to assert in your tests.

@TavoNiievez TavoNiievez changed the title Refactor MailerAssertionsTrait Refactor email assertions Jan 15, 2021
@TavoNiievez TavoNiievez marked this pull request as ready for review January 15, 2021 03:05
@TavoNiievez
Copy link
Member Author

@ThomasLandauer please review this.

This fixes your issue Codeception/Codeception#4698 so I am complying with what is mentioned in #24 (comment)

@TavoNiievez TavoNiievez added this to the 2.0.0 milestone Jan 15, 2021
@TavoNiievez TavoNiievez merged commit 097c66c into Codeception:master Jan 17, 2021
@TavoNiievez TavoNiievez deleted the mailer_refactor branch January 17, 2021 01:02
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.

1 participant