Skip to content

Commit 9c2af36

Browse files
committed
[SwiftMailerHandler] Fixed 'method' option name under email_prototype
1 parent 253fcda commit 9c2af36

File tree

2 files changed

+28
-1
lines changed

2 files changed

+28
-1
lines changed

DependencyInjection/Configuration.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ public function getConfigTreeBuilder()
109109
->end()
110110
->children()
111111
->scalarNode('id')->isRequired()->end()
112-
->scalarNode('factory-method')->defaultNull()->end()
112+
->scalarNode('method')->defaultNull()->end()
113113
->end()
114114
->end()
115115
->scalarNode('connection_string')->end() // socket_handler

Tests/DependencyInjection/ConfigurationTest.php

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,33 @@ public function testMergingInvalidChannels()
186186
$config = $this->process($configs);
187187
}
188188

189+
public function testWithSwiftMailerHandler()
190+
{
191+
$configs = array(
192+
array(
193+
'handlers' => array(
194+
'swift' => array(
195+
'type' => 'swift_mailer',
196+
'from_email' => '[email protected]',
197+
'to_email' => '[email protected]',
198+
'subject' => 'Subject',
199+
'email_prototype' => array(
200+
'id' => 'monolog.prototype',
201+
'method' => 'getPrototype'
202+
)
203+
)
204+
)
205+
)
206+
);
207+
208+
$config = $this->process($configs);
209+
210+
// Check email_prototype
211+
$this->assertCount(2, $config['handlers']['swift']['email_prototype']);
212+
$this->assertEquals('monolog.prototype', $config['handlers']['swift']['email_prototype']['id']);
213+
$this->assertEquals('getPrototype', $config['handlers']['swift']['email_prototype']['method']);
214+
}
215+
189216
public function testWithType()
190217
{
191218
$configs = array(

0 commit comments

Comments
 (0)