@@ -505,7 +505,7 @@ and headers.
505505
506506 .. code-block :: yaml
507507
508- # config/packages/dev/ mailer.yaml
508+ # config/packages/mailer.yaml
509509 framework :
510510 mailer :
511511 envelope :
@@ -1360,10 +1360,11 @@ the mailer configuration file (e.g. in the ``dev`` or ``test`` environments):
13601360
13611361 .. code-block :: yaml
13621362
1363- # config/packages/dev/mailer.yaml
1364- framework :
1365- mailer :
1366- dsn : ' null://null'
1363+ # config/packages/mailer.yaml
1364+ when@dev :
1365+ framework :
1366+ mailer :
1367+ dsn : ' null://null'
13671368
13681369 .. code-block :: xml
13691370
@@ -1408,11 +1409,12 @@ a specific address, instead of the *real* address:
14081409
14091410 .. code-block :: yaml
14101411
1411- # config/packages/dev/mailer.yaml
1412- framework :
1413- mailer :
1414- envelope :
1415- recipients : ['youremail@example.com']
1412+ # config/packages/mailer.yaml
1413+ when@dev :
1414+ framework :
1415+ mailer :
1416+ envelope :
1417+ recipients : ['youremail@example.com']
14161418
14171419 .. code-block :: xml
14181420
@@ -1451,22 +1453,22 @@ a specific address, instead of the *real* address:
14511453 Write a Functional Test
14521454~~~~~~~~~~~~~~~~~~~~~~~
14531455
1454- To functionally test that an email was sent, and even assert the email content or headers,
1455- you can use the built in assertions::
1456+ Symfony provides lots of :ref: `built-in mailer assertions <mailer-assertions >`
1457+ to functionally test that an email was sent, its contents or headers, etc.
1458+ They are available in test classes extending
1459+ :class: `Symfony\\ Bundle\\ FrameworkBundle\\ Test\\ KernelTestCase ` or when using
1460+ the :class: `Symfony\\ Bundle\\ FrameworkBundle\\ Test\\ MailerAssertionsTrait `::
14561461
14571462 // tests/Controller/MailControllerTest.php
14581463 namespace App\Tests\Controller;
14591464
1460- use Symfony\Bundle\FrameworkBundle\Test\MailerAssertionsTrait;
14611465 use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
14621466
14631467 class MailControllerTest extends WebTestCase
14641468 {
1465- use MailerAssertionsTrait;
1466-
14671469 public function testMailIsSentAndContentIsOk()
14681470 {
1469- $client = $this-> createClient();
1471+ $client = static:: createClient();
14701472 $client->request('GET', '/mail/send');
14711473 $this->assertResponseIsSuccessful();
14721474
0 commit comments