Skip to content

Commit d9084f5

Browse files
Update MailerAssertionsTrait.php: Adding Mailpit (#204)
1 parent 15fd142 commit d9084f5

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

src/Codeception/Module/Symfony/MailerAssertionsTrait.php

+9-5
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,7 @@ public function assertQueuedEmailCount(int $count, ?string $transport = null, st
7272
/**
7373
* Checks that no email was sent.
7474
* 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.
7776
*
7877
* ```php
7978
* <?php
@@ -88,7 +87,7 @@ public function dontSeeEmailIsSent(): void
8887
/**
8988
* Returns the last sent email.
9089
* 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.
9291
* See also: [grabSentEmails()](https://codeception.com/docs/modules/Symfony#grabSentEmails)
9392
*
9493
* ```php
@@ -110,7 +109,7 @@ public function grabLastSentEmail(): ?Email
110109
/**
111110
* Returns an array of all sent emails.
112111
* 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.
114113
* See also: [grabLastSentEmail()](https://codeception.com/docs/modules/Symfony#grabLastSentEmail)
115114
*
116115
* ```php
@@ -128,7 +127,12 @@ public function grabSentEmails(): array
128127
/**
129128
* Checks if the given number of emails was sent (default `$expectedCount`: 1).
130129
* 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.
132136
*
133137
* ```php
134138
* <?php

0 commit comments

Comments
 (0)