@@ -2037,21 +2037,27 @@ public function testHttpClientRateLimiter()
2037
2037
$ this ->assertSame ('foo.throttling.limiter ' , (string ) $ arguments [1 ]);
2038
2038
}
2039
2039
2040
- public static function provideMailer (): array
2040
+ public static function provideMailer (): iterable
2041
2041
{
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
+
2046
+ ];
2047
+ yield [
2048
+ 'mailer_with_transports ' ,
2049
+ [
2045
2050
'transport1 ' => 'smtp://example1.com ' ,
2046
2051
'transport2 ' => 'smtp://example2.com ' ,
2047
- ]],
2052
+ ],
2053
+
2048
2054
];
2049
2055
}
2050
2056
2051
2057
/**
2052
2058
* @dataProvider provideMailer
2053
2059
*/
2054
- public function testMailer (string $ configFile , array $ expectedTransports )
2060
+ public function testMailer (string $ configFile , array $ expectedTransports, array $ expectedRecipients )
2055
2061
{
2056
2062
$ container = $ this ->createContainerFromFile ($ configFile );
2057
2063
@@ -2063,7 +2069,7 @@ public function testMailer(string $configFile, array $expectedTransports)
2063
2069
$ this ->assertTrue ($ container ->hasDefinition ('mailer.envelope_listener ' ));
2064
2070
$ l = $ container ->getDefinition ('mailer.envelope_listener ' );
2065
2071
$ this ->
assertSame (
'[email protected] ' ,
$ l->
getArgument (
0 ));
2066
- $ this ->
assertSame (
[ ' [email protected] ' , ' [email protected] ' ] ,
$ l->
getArgument (
1 ));
2072
+ $ this ->assertSame ($ expectedRecipients , $ l ->getArgument (1 ));
2067
2073
$ this ->assertEquals (new Reference ('messenger.default_bus ' , ContainerInterface::NULL_ON_INVALID_REFERENCE ), $ container ->getDefinition ('mailer.mailer ' )->getArgument (1 ));
2068
2074
2069
2075
$ this ->assertTrue ($ container ->hasDefinition ('mailer.message_listener ' ));
0 commit comments