From f3aca436fb8dc925d4f160a36a5089d70128732b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Sch=C3=A4dlich?= Date: Sun, 23 May 2021 11:04:30 +0200 Subject: [PATCH] Add warning if transport factory was not added for new bridge --- .../Tests/DependencyInjection/FrameworkExtensionTest.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/FrameworkExtensionTest.php b/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/FrameworkExtensionTest.php index 02f8748c3d996..b9881ddf16634 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/FrameworkExtensionTest.php +++ b/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/FrameworkExtensionTest.php @@ -1874,13 +1874,18 @@ public function testNotifierWithoutTransports() $this->assertFalse($container->hasDefinition('texter')); } + /** + * @doesNotPerformAssertions + */ public function testIfNotifierTransportsAreKnownByFrameworkExtension() { $container = $this->createContainerFromFile('notifier'); foreach ((new Finder())->in(\dirname(__DIR__, 4).'/Component/Notifier/Bridge')->directories()->depth(0)->exclude('Mercure') as $bridgeDirectory) { $transportFactoryName = strtolower($bridgeDirectory->getFilename()); - $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())); + if (!$container->hasDefinition('notifier.transport_factory.'.$transportFactoryName)) { + $this->addWarning(sprintf('The TransportFactory service "%s" is missing. Please don\'t forget to add the TransportFactory: "%s" to the $classToServices array in the FrameworkBundleExtension.', 'notifier.transport_factory.'.$transportFactoryName, $bridgeDirectory->getFilename())); + } } } 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