Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 044c21b

Browse filesBrowse files
committed
Merge branch '5.4' into 6.4
* 5.4: [FrameworkBundle] Fix mailer config with XML
2 parents 71c441e + 322b40a commit 044c21b
Copy full SHA for 044c21b

File tree

Expand file treeCollapse file tree

7 files changed

+20
-15
lines changed
Filter options
Expand file treeCollapse file tree

7 files changed

+20
-15
lines changed

‎DependencyInjection/Configuration.php

Copy file name to clipboardExpand all lines: DependencyInjection/Configuration.php
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2199,6 +2199,7 @@ private function addMailerSection(ArrayNodeDefinition $rootNode, callable $enabl
21992199
->end()
22002200
->arrayNode('envelope')
22012201
->info('Mailer Envelope configuration')
2202+
->fixXmlConfig('recipient')
22022203
->children()
22032204
->scalarNode('sender')->end()
22042205
->arrayNode('recipients')

‎Resources/config/schema/symfony-1.0.xsd

Copy file name to clipboardExpand all lines: Resources/config/schema/symfony-1.0.xsd
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -781,7 +781,7 @@
781781
<xsd:complexType name="mailer_envelope">
782782
<xsd:sequence>
783783
<xsd:element name="sender" type="xsd:string" minOccurs="0" maxOccurs="1" />
784-
<xsd:element name="recipients" type="xsd:string" minOccurs="0" maxOccurs="unbounded" />
784+
<xsd:element name="recipient" type="xsd:string" minOccurs="0" maxOccurs="unbounded" />
785785
</xsd:sequence>
786786
</xsd:complexType>
787787

‎Tests/DependencyInjection/Fixtures/php/mailer_with_dsn.php

Copy file name to clipboardExpand all lines: Tests/DependencyInjection/Fixtures/php/mailer_with_dsn.php
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
'dsn' => 'smtp://example.com',
1313
'envelope' => [
1414
'sender' => 'sender@example.org',
15-
'recipients' => ['redirected@example.org', 'redirected1@example.org'],
15+
'recipients' => ['redirected@example.org'],
1616
],
1717
'headers' => [
1818
'from' => 'from@example.org',

‎Tests/DependencyInjection/Fixtures/xml/mailer_with_dsn.xml

Copy file name to clipboardExpand all lines: Tests/DependencyInjection/Fixtures/xml/mailer_with_dsn.xml
+1-2Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,7 @@
1212
<framework:mailer dsn="smtp://example.com">
1313
<framework:envelope>
1414
<framework:sender>sender@example.org</framework:sender>
15-
<framework:recipients>redirected@example.org</framework:recipients>
16-
<framework:recipients>redirected1@example.org</framework:recipients>
15+
<framework:recipient>redirected@example.org</framework:recipient>
1716
</framework:envelope>
1817
<framework:header name="from">from@example.org</framework:header>
1918
<framework:header name="bcc">bcc1@example.org</framework:header>

‎Tests/DependencyInjection/Fixtures/xml/mailer_with_transports.xml

Copy file name to clipboardExpand all lines: Tests/DependencyInjection/Fixtures/xml/mailer_with_transports.xml
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@
1414
<framework:transport name="transport2">smtp://example2.com</framework:transport>
1515
<framework:envelope>
1616
<framework:sender>sender@example.org</framework:sender>
17-
<framework:recipients>redirected@example.org</framework:recipients>
18-
<framework:recipients>redirected1@example.org</framework:recipients>
17+
<framework:recipient>redirected@example.org</framework:recipient>
18+
<framework:recipient>redirected1@example.org</framework:recipient>
1919
</framework:envelope>
2020
<framework:header name="from">from@example.org</framework:header>
2121
<framework:header name="bcc">bcc1@example.org</framework:header>

‎Tests/DependencyInjection/Fixtures/yml/mailer_with_dsn.yml

Copy file name to clipboardExpand all lines: Tests/DependencyInjection/Fixtures/yml/mailer_with_dsn.yml
-1Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ framework:
1010
sender: sender@example.org
1111
recipients:
1212
- redirected@example.org
13-
- redirected1@example.org
1413
headers:
1514
from: from@example.org
1615
bcc: [bcc1@example.org, bcc2@example.org]

‎Tests/DependencyInjection/FrameworkExtensionTestCase.php

Copy file name to clipboardExpand all lines: Tests/DependencyInjection/FrameworkExtensionTestCase.php
+14-8Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -361,7 +361,7 @@ public function testWorkflows()
361361
$this->assertSame('state_machine.pull_request.metadata_store', (string) $metadataStoreReference);
362362

363363
$metadataStoreDefinition = $container->getDefinition('state_machine.pull_request.metadata_store');
364-
$this->assertSame(Workflow\Metadata\InMemoryMetadataStore::class, $metadataStoreDefinition->getClass());
364+
$this->assertSame(InMemoryMetadataStore::class, $metadataStoreDefinition->getClass());
365365
$this->assertSame(InMemoryMetadataStore::class, $metadataStoreDefinition->getClass());
366366

367367
$workflowMetadata = $metadataStoreDefinition->getArgument(0);
@@ -2056,21 +2056,27 @@ public function testHttpClientFullDefaultOptions()
20562056
$this->assertSame(['foo' => ['bar' => 'baz']], $defaultOptions['extra']);
20572057
}
20582058

2059-
public static function provideMailer(): array
2059+
public static function provideMailer(): iterable
20602060
{
2061-
return [
2062-
['mailer_with_dsn', ['main' => 'smtp://example.com']],
2063-
['mailer_with_transports', [
2061+
yield [
2062+
'mailer_with_dsn',
2063+
['main' => 'smtp://example.com'],
2064+
['redirected@example.org'],
2065+
];
2066+
yield [
2067+
'mailer_with_transports',
2068+
[
20642069
'transport1' => 'smtp://example1.com',
20652070
'transport2' => 'smtp://example2.com',
2066-
]],
2071+
],
2072+
['redirected@example.org', 'redirected1@example.org'],
20672073
];
20682074
}
20692075

20702076
/**
20712077
* @dataProvider provideMailer
20722078
*/
2073-
public function testMailer(string $configFile, array $expectedTransports)
2079+
public function testMailer(string $configFile, array $expectedTransports, array $expectedRecipients)
20742080
{
20752081
$container = $this->createContainerFromFile($configFile);
20762082

@@ -2082,7 +2088,7 @@ public function testMailer(string $configFile, array $expectedTransports)
20822088
$this->assertTrue($container->hasDefinition('mailer.envelope_listener'));
20832089
$l = $container->getDefinition('mailer.envelope_listener');
20842090
$this->assertSame('sender@example.org', $l->getArgument(0));
2085-
$this->assertSame(['redirected@example.org', 'redirected1@example.org'], $l->getArgument(1));
2091+
$this->assertSame($expectedRecipients, $l->getArgument(1));
20862092
$this->assertEquals(new Reference('messenger.default_bus', ContainerInterface::NULL_ON_INVALID_REFERENCE), $container->getDefinition('mailer.mailer')->getArgument(1));
20872093

20882094
$this->assertTrue($container->hasDefinition('mailer.message_listener'));

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.