You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/Codeception/Module/Symfony/MailerAssertionsTrait.php
+10-5Lines changed: 10 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -13,17 +13,18 @@ trait MailerAssertionsTrait
13
13
{
14
14
/**
15
15
* Checks that no email was sent.
16
+
* The check is based on `\Symfony\Component\Mailer\EventListener\MessageLoggerListener`, which means:
17
+
* 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.
* 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).
25
+
* Checks if the given number of emails was sent (default `$expectedCount`: 1).
26
+
* The check is based on `\Symfony\Component\Mailer\EventListener\MessageLoggerListener`, which means:
27
+
* 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.
27
28
*
28
29
* ```php
29
30
* <?php
@@ -39,6 +40,8 @@ public function seeEmailIsSent(int $expectedCount = 1): void
39
40
40
41
/**
41
42
* Returns the last sent email.
43
+
* The function is based on `\Symfony\Component\Mailer\EventListener\MessageLoggerListener`, which means:
44
+
* 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.
42
45
*
43
46
* ```php
44
47
* <?php
@@ -61,6 +64,8 @@ public function grabLastSentEmail(): ?Email
61
64
62
65
/**
63
66
* Returns an array of all sent emails.
67
+
* The function is based on `\Symfony\Component\Mailer\EventListener\MessageLoggerListener`, which means:
68
+
* 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.
64
69
*
65
70
* ```php
66
71
* <?php
@@ -90,4 +95,4 @@ protected function getMessageMailerEvents(): MessageEvents
90
95
91
96
$this->fail("Emails can't be tested without Symfony Mailer service.");
0 commit comments