diff --git a/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Configuration.php b/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Configuration.php
index 487759a87a1ba..777097647cd0f 100644
--- a/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Configuration.php
+++ b/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Configuration.php
@@ -1897,6 +1897,7 @@ private function addMailerSection(ArrayNodeDefinition $rootNode, callable $enabl
->end()
->arrayNode('envelope')
->info('Mailer Envelope configuration')
+ ->fixXmlConfig('recipient')
->children()
->scalarNode('sender')->end()
->arrayNode('recipients')
diff --git a/src/Symfony/Bundle/FrameworkBundle/Resources/config/schema/symfony-1.0.xsd b/src/Symfony/Bundle/FrameworkBundle/Resources/config/schema/symfony-1.0.xsd
index faee50e2528a8..60e87a1bcf43c 100644
--- a/src/Symfony/Bundle/FrameworkBundle/Resources/config/schema/symfony-1.0.xsd
+++ b/src/Symfony/Bundle/FrameworkBundle/Resources/config/schema/symfony-1.0.xsd
@@ -703,7 +703,7 @@
-
+
diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/mailer_with_dsn.php b/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/mailer_with_dsn.php
index df2ca46e46ee9..2f10631f00520 100644
--- a/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/mailer_with_dsn.php
+++ b/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/mailer_with_dsn.php
@@ -8,7 +8,7 @@
'dsn' => 'smtp://example.com',
'envelope' => [
'sender' => 'sender@example.org',
- 'recipients' => ['redirected@example.org', 'redirected1@example.org'],
+ 'recipients' => ['redirected@example.org'],
],
'headers' => [
'from' => 'from@example.org',
diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/xml/mailer_with_dsn.xml b/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/xml/mailer_with_dsn.xml
index be53f59bc3cad..06109accc233d 100644
--- a/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/xml/mailer_with_dsn.xml
+++ b/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/xml/mailer_with_dsn.xml
@@ -10,8 +10,7 @@
sender@example.org
- redirected@example.org
- redirected1@example.org
+ redirected@example.org
from@example.org
bcc1@example.org
diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/xml/mailer_with_transports.xml b/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/xml/mailer_with_transports.xml
index cbe538d33e99c..56a6e61af8114 100644
--- a/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/xml/mailer_with_transports.xml
+++ b/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/xml/mailer_with_transports.xml
@@ -12,8 +12,8 @@
smtp://example2.com
sender@example.org
- redirected@example.org
- redirected1@example.org
+ redirected@example.org
+ redirected1@example.org
from@example.org
bcc1@example.org
diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/yml/mailer_with_dsn.yml b/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/yml/mailer_with_dsn.yml
index f8b3c87c4302c..7aa79560d2db9 100644
--- a/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/yml/mailer_with_dsn.yml
+++ b/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/yml/mailer_with_dsn.yml
@@ -5,7 +5,6 @@ framework:
sender: sender@example.org
recipients:
- redirected@example.org
- - redirected1@example.org
headers:
from: from@example.org
bcc: [bcc1@example.org, bcc2@example.org]
diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/FrameworkExtensionTestCase.php b/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/FrameworkExtensionTestCase.php
index 5e955d0163a31..29c9d411af112 100644
--- a/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/FrameworkExtensionTestCase.php
+++ b/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/FrameworkExtensionTestCase.php
@@ -1940,21 +1940,28 @@ public function testHttpClientFullDefaultOptions()
], $defaultOptions['peer_fingerprint']);
}
- public static function provideMailer(): array
+ public static function provideMailer(): iterable
{
- return [
- ['mailer_with_dsn', ['main' => 'smtp://example.com']],
- ['mailer_with_transports', [
+ yield [
+ 'mailer_with_dsn',
+ ['main' => 'smtp://example.com'],
+ ['redirected@example.org'],
+ ];
+ yield [
+ 'mailer_with_transports',
+ [
'transport1' => 'smtp://example1.com',
'transport2' => 'smtp://example2.com',
- ]],
+
+ ],
+ ['redirected@example.org', 'redirected1@example.org'],
];
}
/**
* @dataProvider provideMailer
*/
- public function testMailer(string $configFile, array $expectedTransports)
+ public function testMailer(string $configFile, array $expectedTransports, array $expectedRecipients)
{
$container = $this->createContainerFromFile($configFile);
@@ -1966,7 +1973,7 @@ public function testMailer(string $configFile, array $expectedTransports)
$this->assertTrue($container->hasDefinition('mailer.envelope_listener'));
$l = $container->getDefinition('mailer.envelope_listener');
$this->assertSame('sender@example.org', $l->getArgument(0));
- $this->assertSame(['redirected@example.org', 'redirected1@example.org'], $l->getArgument(1));
+ $this->assertSame($expectedRecipients, $l->getArgument(1));
$this->assertEquals(new Reference('messenger.default_bus', ContainerInterface::NULL_ON_INVALID_REFERENCE), $container->getDefinition('mailer.mailer')->getArgument(1));
$this->assertTrue($container->hasDefinition('mailer.message_listener'));
diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/XmlFrameworkExtensionTest.php b/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/XmlFrameworkExtensionTest.php
index 4a2ff788bf5c6..3b388812fd60e 100644
--- a/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/XmlFrameworkExtensionTest.php
+++ b/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/XmlFrameworkExtensionTest.php
@@ -14,7 +14,6 @@
use Symfony\Component\Config\FileLocator;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Loader\XmlFileLoader;
-use Symfony\Component\RateLimiter\Policy\SlidingWindowLimiter;
class XmlFrameworkExtensionTest extends FrameworkExtensionTestCase
{