@@ -547,7 +547,7 @@ and headers.
547547
548548 .. code-block :: yaml
549549
550- # config/packages/dev/ mailer.yaml
550+ # config/packages/mailer.yaml
551551 framework :
552552 mailer :
553553 envelope :
@@ -1648,10 +1648,11 @@ the mailer configuration file (e.g. in the ``dev`` or ``test`` environments):
16481648
16491649 .. code-block :: yaml
16501650
1651- # config/packages/dev/mailer.yaml
1652- framework :
1653- mailer :
1654- dsn : ' null://null'
1651+ # config/packages/mailer.yaml
1652+ when@dev :
1653+ framework :
1654+ mailer :
1655+ dsn : ' null://null'
16551656
16561657 .. code-block :: xml
16571658
@@ -1696,11 +1697,12 @@ a specific address, instead of the *real* address:
16961697
16971698 .. code-block :: yaml
16981699
1699- # config/packages/dev/mailer.yaml
1700- framework :
1701- mailer :
1702- envelope :
1703- recipients : ['youremail@example.com']
1700+ # config/packages/mailer.yaml
1701+ when@dev :
1702+ framework :
1703+ mailer :
1704+ envelope :
1705+ recipients : ['youremail@example.com']
17041706
17051707 .. code-block :: xml
17061708
@@ -1739,22 +1741,22 @@ a specific address, instead of the *real* address:
17391741 Write a Functional Test
17401742~~~~~~~~~~~~~~~~~~~~~~~
17411743
1742- To functionally test that an email was sent, and even assert the email content or headers,
1743- you can use the built in assertions::
1744+ Symfony provides lots of :ref: `built-in mailer assertions <mailer-assertions >`
1745+ to functionally test that an email was sent, its contents or headers, etc.
1746+ They are available in test classes extending
1747+ :class: `Symfony\\ Bundle\\ FrameworkBundle\\ Test\\ KernelTestCase ` or when using
1748+ the :class: `Symfony\\ Bundle\\ FrameworkBundle\\ Test\\ MailerAssertionsTrait `::
17441749
17451750 // tests/Controller/MailControllerTest.php
17461751 namespace App\Tests\Controller;
17471752
1748- use Symfony\Bundle\FrameworkBundle\Test\MailerAssertionsTrait;
17491753 use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
17501754
17511755 class MailControllerTest extends WebTestCase
17521756 {
1753- use MailerAssertionsTrait;
1754-
17551757 public function testMailIsSentAndContentIsOk()
17561758 {
1757- $client = $this-> createClient();
1759+ $client = static:: createClient();
17581760 $client->request('GET', '/mail/send');
17591761 $this->assertResponseIsSuccessful();
17601762
0 commit comments