@@ -512,7 +512,7 @@ and headers.
512512
513513 .. code-block :: yaml
514514
515- # config/packages/dev/ mailer.yaml
515+ # config/packages/mailer.yaml
516516 framework :
517517 mailer :
518518 envelope :
@@ -1440,10 +1440,11 @@ the mailer configuration file (e.g. in the ``dev`` or ``test`` environments):
14401440
14411441 .. code-block :: yaml
14421442
1443- # config/packages/dev/mailer.yaml
1444- framework :
1445- mailer :
1446- dsn : ' null://null'
1443+ # config/packages/mailer.yaml
1444+ when@dev :
1445+ framework :
1446+ mailer :
1447+ dsn : ' null://null'
14471448
14481449 .. code-block :: xml
14491450
@@ -1488,11 +1489,12 @@ a specific address, instead of the *real* address:
14881489
14891490 .. code-block :: yaml
14901491
1491- # config/packages/dev/mailer.yaml
1492- framework :
1493- mailer :
1494- envelope :
1495- recipients : ['youremail@example.com']
1492+ # config/packages/mailer.yaml
1493+ when@dev :
1494+ framework :
1495+ mailer :
1496+ envelope :
1497+ recipients : ['youremail@example.com']
14961498
14971499 .. code-block :: xml
14981500
@@ -1531,22 +1533,22 @@ a specific address, instead of the *real* address:
15311533 Write a Functional Test
15321534~~~~~~~~~~~~~~~~~~~~~~~
15331535
1534- To functionally test that an email was sent, and even assert the email content or headers,
1535- you can use the built in assertions::
1536+ Symfony provides lots of :ref: `built-in mailer assertions <mailer-assertions >`
1537+ to functionally test that an email was sent, its contents or headers, etc.
1538+ They are available in test classes extending
1539+ :class: `Symfony\\ Bundle\\ FrameworkBundle\\ Test\\ KernelTestCase ` or when using
1540+ the :class: `Symfony\\ Bundle\\ FrameworkBundle\\ Test\\ MailerAssertionsTrait `::
15361541
15371542 // tests/Controller/MailControllerTest.php
15381543 namespace App\Tests\Controller;
15391544
1540- use Symfony\Bundle\FrameworkBundle\Test\MailerAssertionsTrait;
15411545 use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
15421546
15431547 class MailControllerTest extends WebTestCase
15441548 {
1545- use MailerAssertionsTrait;
1546-
15471549 public function testMailIsSentAndContentIsOk()
15481550 {
1549- $client = $this-> createClient();
1551+ $client = static:: createClient();
15501552 $client->request('GET', '/mail/send');
15511553 $this->assertResponseIsSuccessful();
15521554
0 commit comments