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
+9-5
Original file line number
Diff line number
Diff line change
@@ -72,8 +72,7 @@ public function assertQueuedEmailCount(int $count, ?string $transport = null, st
72
72
/**
73
73
* Checks that no email was sent.
74
74
* The check is based on `\Symfony\Component\Mailer\EventListener\MessageLoggerListener`, which means:
75
-
* If your app performs an HTTP redirect, you need to suppress it using [stopFollowingRedirects()](https://codeception.com/docs/modules/Symfony#stopFollowingRedirects) first;
76
-
* otherwise this check will *always* pass.
75
+
* If your app performs an HTTP redirect, you need to suppress it using [stopFollowingRedirects()](#stopFollowingRedirects) first; otherwise this check will *always* pass.
77
76
*
78
77
* ```php
79
78
* <?php
@@ -88,7 +87,7 @@ public function dontSeeEmailIsSent(): void
88
87
/**
89
88
* Returns the last sent email.
90
89
* The function is based on `\Symfony\Component\Mailer\EventListener\MessageLoggerListener`, which means:
91
-
* If your app performs an HTTP redirect after sending the email, you need to suppress it using [stopFollowingRedirects()](https://codeception.com/docs/modules/Symfony#stopFollowingRedirects) first.
90
+
* If your app performs an HTTP redirect after sending the email, you need to suppress it using [stopFollowingRedirects()](#stopFollowingRedirects) first.
92
91
* See also: [grabSentEmails()](https://codeception.com/docs/modules/Symfony#grabSentEmails)
93
92
*
94
93
* ```php
@@ -110,7 +109,7 @@ public function grabLastSentEmail(): ?Email
110
109
/**
111
110
* Returns an array of all sent emails.
112
111
* The function is based on `\Symfony\Component\Mailer\EventListener\MessageLoggerListener`, which means:
113
-
* If your app performs an HTTP redirect after sending the email, you need to suppress it using [stopFollowingRedirects()](https://codeception.com/docs/modules/Symfony#stopFollowingRedirects) first.
112
+
* If your app performs an HTTP redirect after sending the email, you need to suppress it using [stopFollowingRedirects()](#stopFollowingRedirects) first.
114
113
* See also: [grabLastSentEmail()](https://codeception.com/docs/modules/Symfony#grabLastSentEmail)
115
114
*
116
115
* ```php
@@ -128,7 +127,12 @@ public function grabSentEmails(): array
128
127
/**
129
128
* Checks if the given number of emails was sent (default `$expectedCount`: 1).
130
129
* The check is based on `\Symfony\Component\Mailer\EventListener\MessageLoggerListener`, which means:
131
-
* If your app performs an HTTP redirect after sending the email, you need to suppress it using [stopFollowingRedirects()](https://codeception.com/docs/modules/Symfony#stopFollowingRedirects) first.
130
+
* If your app performs an HTTP redirect after sending the email, you need to suppress it using [stopFollowingRedirects()](#stopFollowingRedirects) first.
131
+
*
132
+
* Limitation:
133
+
* If your mail is sent in a Symfony console command and you start that command in your test with [$I->runShellCommand()](https://codeception.com/docs/modules/Cli#runShellCommand),
134
+
* Codeception will not notice it.
135
+
* As a more professional alternative, we recommend Mailpit (see [Addons](https://codeception.com/addons)), which also lets you test the content of the mail.
0 commit comments