Skip to content

Commit 8f84906

Browse files
Explaining the stopFollowingRedirects() restriction for email
See Codeception#107 (comment)
1 parent 42dda3c commit 8f84906

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

src/Codeception/Module/Symfony/MailerAssertionsTrait.php

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,9 @@ public function dontSeeEmailIsSent(): void
2020
}
2121

2222
/**
23-
* Checks if the desired number of emails was sent.
24-
* Asserts that 1 email was sent by default, specify the `expectedCount` parameter to modify it.
25-
* The email is checked using Symfony message logger, which means:
26-
* * If your app performs a redirect after sending the email, you need to suppress it using [stopFollowingRedirects](https://codeception.com/docs/modules/Symfony#stopFollowingRedirects).
23+
* Checks if the given number of emails was sent (default `$expectedCount`: 1).
24+
* The check is based on `\Symfony\Component\Mailer\EventListener\MessageLoggerListener`, which means:
25+
* 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.
2726
*
2827
* ```php
2928
* <?php
@@ -90,4 +89,4 @@ protected function getMessageMailerEvents(): MessageEvents
9089

9190
$this->fail("Emails can't be tested without Symfony Mailer service.");
9291
}
93-
}
92+
}

0 commit comments

Comments
 (0)