@@ -2037,21 +2037,27 @@ public function testHttpClientRateLimiter()
20372037 $ this ->assertSame ('foo.throttling.limiter ' , (string ) $ arguments [1 ]);
20382038 }
20392039
2040- public static function provideMailer (): array
2040+ public static function provideMailer (): iterable
20412041 {
2042- return [
2043- ['mailer_with_dsn ' , ['main ' => 'smtp://example.com ' ]],
2044- ['mailer_with_transports ' , [
2042+ yield [
2043+ 'mailer_with_dsn ' ,
2044+ ['main ' => 'smtp://example.com ' ],
2045+ ['redirected@example.org ' ],
2046+ ];
2047+ yield [
2048+ 'mailer_with_transports ' ,
2049+ [
20452050 'transport1 ' => 'smtp://example1.com ' ,
20462051 'transport2 ' => 'smtp://example2.com ' ,
2047- ]],
2052+ ],
2053+ ['redirected@example.org ' , 'redirected1@example.org ' ],
20482054 ];
20492055 }
20502056
20512057 /**
20522058 * @dataProvider provideMailer
20532059 */
2054- public function testMailer (string $ configFile , array $ expectedTransports )
2060+ public function testMailer (string $ configFile , array $ expectedTransports, array $ expectedRecipients )
20552061 {
20562062 $ container = $ this ->createContainerFromFile ($ configFile );
20572063
@@ -2063,7 +2069,7 @@ public function testMailer(string $configFile, array $expectedTransports)
20632069 $ this ->assertTrue ($ container ->hasDefinition ('mailer.envelope_listener ' ));
20642070 $ l = $ container ->getDefinition ('mailer.envelope_listener ' );
20652071 $ this ->assertSame ('sender@example.org ' , $ l ->getArgument (0 ));
2066- $ this ->assertSame ([ ' redirected@example.org ' , ' redirected1@example.org ' ] , $ l ->getArgument (1 ));
2072+ $ this ->assertSame ($ expectedRecipients , $ l ->getArgument (1 ));
20672073 $ this ->assertEquals (new Reference ('messenger.default_bus ' , ContainerInterface::NULL_ON_INVALID_REFERENCE ), $ container ->getDefinition ('mailer.mailer ' )->getArgument (1 ));
20682074
20692075 $ this ->assertTrue ($ container ->hasDefinition ('mailer.message_listener ' ));
0 commit comments