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-4
Original file line number
Diff line number
Diff line change
@@ -50,7 +50,7 @@ public function assertQueuedEmailCount(int $count, ?string $transport = null, st
50
50
/**
51
51
* Checks that no email was sent.
52
52
* The check is based on `\Symfony\Component\Mailer\EventListener\MessageLoggerListener`, which means:
53
-
* If your app performs an HTTP redirect, you need to suppress it using [stopFollowingRedirects()](https://codeception.com/docs/modules/Symfony#stopFollowingRedirects) first; otherwise this check will *always* pass.
53
+
* If your app performs an HTTP redirect, you need to suppress it using [stopFollowingRedirects()](#stopFollowingRedirects) first; otherwise this check will *always* pass.
54
54
*/
55
55
publicfunctiondontSeeEmailIsSent(): void
56
56
{
@@ -60,7 +60,7 @@ public function dontSeeEmailIsSent(): void
60
60
/**
61
61
* Returns the last sent email.
62
62
* The function is based on `\Symfony\Component\Mailer\EventListener\MessageLoggerListener`, which means:
63
-
* 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.
63
+
* If your app performs an HTTP redirect after sending the email, you need to suppress it using [stopFollowingRedirects()](#stopFollowingRedirects) first.
64
64
* See also: [grabSentEmails()](https://codeception.com/docs/modules/Symfony#grabSentEmails)
65
65
*
66
66
* ```php
@@ -82,7 +82,7 @@ public function grabLastSentEmail(): ?Email
82
82
/**
83
83
* Returns an array of all sent emails.
84
84
* The function is based on `\Symfony\Component\Mailer\EventListener\MessageLoggerListener`, which means:
85
-
* 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.
85
+
* If your app performs an HTTP redirect after sending the email, you need to suppress it using [stopFollowingRedirects()](#stopFollowingRedirects) first.
86
86
* See also: [grabLastSentEmail()](https://codeception.com/docs/modules/Symfony#grabLastSentEmail)
87
87
*
88
88
* ```php
@@ -100,7 +100,12 @@ public function grabSentEmails(): array
100
100
/**
101
101
* Checks if the given number of emails was sent (default `$expectedCount`: 1).
102
102
* The check is based on `\Symfony\Component\Mailer\EventListener\MessageLoggerListener`, which means:
103
-
* 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.
103
+
* If your app performs an HTTP redirect after sending the email, you need to suppress it using [stopFollowingRedirects()](#stopFollowingRedirects) first.
104
+
*
105
+
* Limitation:
106
+
* 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),
107
+
* Codeception will not notice it.
108
+
* As a more professional alternative, we recommend Mailpit, wchich also lets you test the content of the mail.
0 commit comments