Skip to content

Commit ddf61c2

Browse files
committed
Make sure we will not forget to add notifier transport factories to FrameworkExtension anymore
1 parent 0edc8e3 commit ddf61c2

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

src/Symfony/Bundle/FrameworkBundle/Resources/config/schema/symfony-1.0.xsd

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -628,6 +628,7 @@
628628
<xsd:element name="envelope" type="mailer_envelope" minOccurs="0" maxOccurs="1" />
629629
<xsd:element name="header" type="header" minOccurs="0" maxOccurs="unbounded" />
630630
</xsd:sequence>
631+
<xsd:attribute name="enabled" type="xsd:boolean" />
631632
<xsd:attribute name="dsn" type="xsd:string" />
632633
<xsd:attribute name="message-bus" type="xsd:string" />
633634
</xsd:complexType>

src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/FrameworkExtensionTest.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@
4545
use Symfony\Component\DependencyInjection\ParameterBag\EnvPlaceholderParameterBag;
4646
use Symfony\Component\DependencyInjection\Reference;
4747
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
48+
use Symfony\Component\Finder\Finder;
4849
use Symfony\Component\Form\Form;
4950
use Symfony\Component\HttpClient\MockHttpClient;
5051
use Symfony\Component\HttpClient\RetryableHttpClient;
@@ -1873,6 +1874,16 @@ public function testNotifierWithoutTransports()
18731874
$this->assertFalse($container->hasDefinition('texter'));
18741875
}
18751876

1877+
public function testIfNotifierTransportsAreKnownByFrameworkExtension()
1878+
{
1879+
$container = $this->createContainerFromFile('notifier');
1880+
1881+
foreach ((new Finder())->in(\dirname(__DIR__, 4).'/Component/Notifier/Bridge')->directories()->depth(0)->exclude('Mercure') as $bridgeDirectory) {
1882+
$transportFactoryName = strtolower($bridgeDirectory->getFilename());
1883+
$this->assertTrue($container->hasDefinition('notifier.transport_factory.'.$transportFactoryName), sprintf('Did you forget to add the TransportFactory: "%s" to the $classToServices array in the FrameworkBundleExtension?', $bridgeDirectory->getFilename()));
1884+
}
1885+
}
1886+
18761887
protected function createContainer(array $data = [])
18771888
{
18781889
return new ContainerBuilder(new EnvPlaceholderParameterBag(array_merge([

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy