-
-
Notifications
You must be signed in to change notification settings - Fork 118
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* 5.4: [FrameworkBundle] Fix mailer config with XML
- Loading branch information
Showing
7 changed files
with
20 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,7 +12,7 @@ | |
'dsn' => 'smtp://example.com', | ||
'envelope' => [ | ||
'sender' => '[email protected]', | ||
'recipients' => ['[email protected]', '[email protected]'], | ||
'recipients' => ['[email protected]'], | ||
], | ||
'headers' => [ | ||
'from' => '[email protected]', | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,8 +12,7 @@ | |
<framework:mailer dsn="smtp://example.com"> | ||
<framework:envelope> | ||
<framework:sender>[email protected]</framework:sender> | ||
<framework:recipients>[email protected]</framework:recipients> | ||
<framework:recipients>[email protected]</framework:recipients> | ||
<framework:recipient>[email protected]</framework:recipient> | ||
</framework:envelope> | ||
<framework:header name="from">[email protected]</framework:header> | ||
<framework:header name="bcc">[email protected]</framework:header> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,8 +14,8 @@ | |
<framework:transport name="transport2">smtp://example2.com</framework:transport> | ||
<framework:envelope> | ||
<framework:sender>[email protected]</framework:sender> | ||
<framework:recipients>[email protected]</framework:recipients> | ||
<framework:recipients>[email protected]</framework:recipients> | ||
<framework:recipient>[email protected]</framework:recipient> | ||
<framework:recipient>[email protected]</framework:recipient> | ||
</framework:envelope> | ||
<framework:header name="from">[email protected]</framework:header> | ||
<framework:header name="bcc">[email protected]</framework:header> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,7 +10,6 @@ framework: | |
sender: [email protected] | ||
recipients: | ||
- [email protected] | ||
- [email protected] | ||
headers: | ||
from: [email protected] | ||
bcc: [[email protected], [email protected]] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -361,7 +361,7 @@ public function testWorkflows() | |
$this->assertSame('state_machine.pull_request.metadata_store', (string) $metadataStoreReference); | ||
|
||
$metadataStoreDefinition = $container->getDefinition('state_machine.pull_request.metadata_store'); | ||
$this->assertSame(Workflow\Metadata\InMemoryMetadataStore::class, $metadataStoreDefinition->getClass()); | ||
$this->assertSame(InMemoryMetadataStore::class, $metadataStoreDefinition->getClass()); | ||
$this->assertSame(InMemoryMetadataStore::class, $metadataStoreDefinition->getClass()); | ||
|
||
$workflowMetadata = $metadataStoreDefinition->getArgument(0); | ||
|
@@ -2056,21 +2056,27 @@ public function testHttpClientFullDefaultOptions() | |
$this->assertSame(['foo' => ['bar' => 'baz']], $defaultOptions['extra']); | ||
} | ||
|
||
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'], | ||
['[email protected]'], | ||
]; | ||
yield [ | ||
'mailer_with_transports', | ||
[ | ||
'transport1' => 'smtp://example1.com', | ||
'transport2' => 'smtp://example2.com', | ||
]], | ||
], | ||
['[email protected]', '[email protected]'], | ||
]; | ||
} | ||
|
||
/** | ||
* @dataProvider provideMailer | ||
*/ | ||
public function testMailer(string $configFile, array $expectedTransports) | ||
public function testMailer(string $configFile, array $expectedTransports, array $expectedRecipients) | ||
{ | ||
$container = $this->createContainerFromFile($configFile); | ||
|
||
|
@@ -2082,7 +2088,7 @@ public function testMailer(string $configFile, array $expectedTransports) | |
$this->assertTrue($container->hasDefinition('mailer.envelope_listener')); | ||
$l = $container->getDefinition('mailer.envelope_listener'); | ||
$this->assertSame('[email protected]', $l->getArgument(0)); | ||
$this->assertSame(['[email protected]', '[email protected]'], $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')); | ||
|