File tree Expand file tree Collapse file tree 5 files changed +35
-1
lines changed
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" />
543
544
<xsd : complexType name =" http_header" mixed =" true" >
544
545
<xsd : attribute name =" name" type =" xsd:string" />
545
546
</xsd : complexType >
547
+
548
+ <xsd : complexType name =" mailer" >
549
+ <xsd : attribute name =" dsn" type =" xsd:string" />
550
+ </xsd : complexType >
546
551
</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 55
55
use Symfony \Component \Validator \DependencyInjection \AddConstraintValidatorsPass ;
56
56
use Symfony \Component \Validator \Mapping \Loader \PropertyInfoLoader ;
57
57
use Symfony \Component \Validator \Util \LegacyTranslatorProxy ;
58
- use Symfony \Component \Validator \Validation ;
59
58
use Symfony \Component \Workflow ;
60
59
61
60
abstract class FrameworkExtensionTest extends TestCase
@@ -1552,6 +1551,14 @@ public function testHttpClientFullDefaultOptions()
1552
1551
], $ defaultOptions ['peer_fingerprint ' ]);
1553
1552
}
1554
1553
1554
+ public function testMailer (): void
1555
+ {
1556
+ $ container = $ this ->createContainerFromFile ('mailer ' );
1557
+
1558
+ $ this ->assertTrue ($ container ->hasAlias ('mailer ' ));
1559
+ $ this ->assertTrue ($ container ->hasDefinition ('mailer.default_transport ' ));
1560
+ }
1561
+
1555
1562
protected function createContainer (array $ data = [])
1556
1563
{
1557
1564
return new ContainerBuilder (new ParameterBag (array_merge ([
You can’t perform that action at this time.
0 commit comments