From c70a4dad77b17c36868ed1bc7c7607bf4975d14e Mon Sep 17 00:00:00 2001 From: Thomas Landauer Date: Wed, 24 Mar 2021 12:00:09 +0100 Subject: [PATCH 1/2] Mentioning Symfony Mailer requirement in v2.0.0 My plan would be to copy this line to all email-related functions. Questions: 1. Is `^1.6` right? 2. The `mailer` configuration was never documented anywhere. But in v1.6, Swift Mailer is the default anyway, right? So this configuration is only relevant for people who still have v1.6 but use Symfony Mailer? And in this case, the better advice is to upgrade to v2, rather than configuring `mailer`? --- src/Codeception/Module/Symfony/MailerAssertionsTrait.php | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Codeception/Module/Symfony/MailerAssertionsTrait.php b/src/Codeception/Module/Symfony/MailerAssertionsTrait.php index 7427a187..6f8ab5c0 100644 --- a/src/Codeception/Module/Symfony/MailerAssertionsTrait.php +++ b/src/Codeception/Module/Symfony/MailerAssertionsTrait.php @@ -25,6 +25,7 @@ public function dontSeeEmailIsSent(): void * Checks if the given number of emails was sent (default `$expectedCount`: 1). * The check is based on `\Symfony\Component\Mailer\EventListener\MessageLoggerListener`, which means: * If your app performs a HTTP redirect after sending the email, you need to suppress it using [stopFollowingRedirects()](https://codeception.com/docs/modules/Symfony#stopFollowingRedirects) first. + * Starting with version 2.0.0, `codeception/module-symfony` requires your app to use [Symfony Mailer](https://symfony.com/doc/current/mailer.html). If your app still uses [Swift Mailer](https://symfony.com/doc/current/email.html), set your version constraint to `^1.6`. * * ```php * Date: Sun, 28 Mar 2021 17:18:14 +0200 Subject: [PATCH 2/2] Update MailerAssertionsTrait.php --- src/Codeception/Module/Symfony/MailerAssertionsTrait.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/Codeception/Module/Symfony/MailerAssertionsTrait.php b/src/Codeception/Module/Symfony/MailerAssertionsTrait.php index 6f8ab5c0..8e52d1e7 100644 --- a/src/Codeception/Module/Symfony/MailerAssertionsTrait.php +++ b/src/Codeception/Module/Symfony/MailerAssertionsTrait.php @@ -15,6 +15,7 @@ trait MailerAssertionsTrait * Checks that no email was sent. * The check is based on `\Symfony\Component\Mailer\EventListener\MessageLoggerListener`, which means: * If your app performs a HTTP redirect, you need to suppress it using [stopFollowingRedirects()](https://codeception.com/docs/modules/Symfony#stopFollowingRedirects) first; otherwise this check will *always* pass. + * Starting with version 2.0.0, `codeception/module-symfony` requires your app to use [Symfony Mailer](https://symfony.com/doc/current/mailer.html). If your app still uses [Swift Mailer](https://symfony.com/doc/current/email.html), set your version constraint to `^1.6`. */ public function dontSeeEmailIsSent(): void { @@ -43,6 +44,7 @@ public function seeEmailIsSent(int $expectedCount = 1): void * Returns the last sent email. * The function is based on `\Symfony\Component\Mailer\EventListener\MessageLoggerListener`, which means: * If your app performs a HTTP redirect after sending the email, you need to suppress it using [stopFollowingRedirects()](https://codeception.com/docs/modules/Symfony#stopFollowingRedirects) first. + * Starting with version 2.0.0, `codeception/module-symfony` requires your app to use [Symfony Mailer](https://symfony.com/doc/current/mailer.html). If your app still uses [Swift Mailer](https://symfony.com/doc/current/email.html), set your version constraint to `^1.6`. * See also: [grabSentEmails()](https://codeception.com/docs/modules/Symfony#grabSentEmails) * * ```php @@ -68,6 +70,7 @@ public function grabLastSentEmail(): ?Email * Returns an array of all sent emails. * The function is based on `\Symfony\Component\Mailer\EventListener\MessageLoggerListener`, which means: * If your app performs a HTTP redirect after sending the email, you need to suppress it using [stopFollowingRedirects()](https://codeception.com/docs/modules/Symfony#stopFollowingRedirects) first. + * Starting with version 2.0.0, `codeception/module-symfony` requires your app to use [Symfony Mailer](https://symfony.com/doc/current/mailer.html). If your app still uses [Swift Mailer](https://symfony.com/doc/current/email.html), set your version constraint to `^1.6`. * See also: [grabLastSentEmail()](https://codeception.com/docs/modules/Symfony#grabLastSentEmail) * * ```php