File tree Expand file tree Collapse file tree 5 files changed +35
-1
lines changed
src/Symfony/Bundle/FrameworkBundle
Tests/DependencyInjection Expand file tree Collapse file tree 5 files changed +35
-1
lines changed Original file line number Diff line number Diff line change 33
33
<xsd : element name =" lock" type =" lock" minOccurs =" 0" maxOccurs =" 1" />
34
34
<xsd : element name =" messenger" type =" messenger" minOccurs =" 0" maxOccurs =" 1" />
35
35
<xsd : element name =" http-client" type =" http_client" minOccurs =" 0" maxOccurs =" 1" />
36
+ <xsd : element name =" mailer" type =" mailer" minOccurs =" 0" maxOccurs =" 1" />
36
37
</xsd : choice >
37
38
38
39
<xsd : attribute name =" http-method-override" type =" xsd:boolean" />
552
553
<xsd : complexType name =" http_header" mixed =" true" >
553
554
<xsd : attribute name =" name" type =" xsd:string" />
554
555
</xsd : complexType >
556
+
557
+ <xsd : complexType name =" mailer" >
558
+ <xsd : attribute name =" dsn" type =" xsd:string" />
559
+ </xsd : complexType >
555
560
</xsd : schema >
Original file line number Diff line number Diff line change
1
+ <?php
2
+
3
+ $ container ->loadFromExtension ('framework ' , [
4
+ 'mailer ' => [
5
+ 'dsn ' => 'smtp://example.com ' ,
6
+ ],
7
+ ]);
Original file line number Diff line number Diff line change
1
+ <?xml version =" 1.0" ?>
2
+
3
+ <container xmlns =" http://symfony.com/schema/dic/services"
4
+ xmlns : xsi =" http://www.w3.org/2001/XMLSchema-instance"
5
+ xmlns : framework =" http://symfony.com/schema/dic/symfony"
6
+ xsi : schemaLocation =" http://symfony.com/schema/dic/services https://symfony.com/schema/dic/services/services-1.0.xsd
7
+ http://symfony.com/schema/dic/symfony https://symfony.com/schema/dic/symfony/symfony-1.0.xsd" >
8
+
9
+ <framework : config >
10
+ <framework : mailer dsn =" smtp://example.com" />
11
+ </framework : config >
12
+ </container >
Original file line number Diff line number Diff line change
1
+ framework :
2
+ mailer :
3
+ dsn : ' smtp://example.com'
Original file line number Diff line number Diff line change 57
57
use Symfony \Component \Validator \DependencyInjection \AddConstraintValidatorsPass ;
58
58
use Symfony \Component \Validator \Mapping \Loader \PropertyInfoLoader ;
59
59
use Symfony \Component \Validator \Util \LegacyTranslatorProxy ;
60
- use Symfony \Component \Validator \Validation ;
61
60
use Symfony \Component \Workflow ;
62
61
63
62
abstract class FrameworkExtensionTest extends TestCase
@@ -1582,6 +1581,14 @@ public function testHttpClientFullDefaultOptions()
1582
1581
], $ defaultOptions ['peer_fingerprint ' ]);
1583
1582
}
1584
1583
1584
+ public function testMailer (): void
1585
+ {
1586
+ $ container = $ this ->createContainerFromFile ('mailer ' );
1587
+
1588
+ $ this ->assertTrue ($ container ->hasAlias ('mailer ' ));
1589
+ $ this ->assertTrue ($ container ->hasDefinition ('mailer.default_transport ' ));
1590
+ }
1591
+
1585
1592
protected function createContainer (array $ data = [])
1586
1593
{
1587
1594
return new ContainerBuilder (new ParameterBag (array_merge ([
You can’t perform that action at this time.
0 commit comments