Skip to content

Commit 468e44b

Browse files
committed
Add warning if transport factory was not added for new bridge
1 parent f27e6cc commit 468e44b

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

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

+8-1
Original file line numberDiff line numberDiff line change
@@ -1874,14 +1874,21 @@ public function testNotifierWithoutTransports()
18741874
$this->assertFalse($container->hasDefinition('texter'));
18751875
}
18761876

1877+
/**
1878+
* @doesNotPerformAssertions
1879+
*/
18771880
public function testIfNotifierTransportsAreKnownByFrameworkExtension()
18781881
{
18791882
$container = $this->createContainerFromFile('notifier');
18801883

18811884
foreach ((new Finder())->in(\dirname(__DIR__, 4).'/Component/Notifier/Bridge')->directories()->depth(0)->exclude('Mercure') as $bridgeDirectory) {
18821885
$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()));
1886+
if (!$container->hasDefinition('notifier.transport_factory.'.$transportFactoryName)) {
1887+
$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()));
1888+
}
18841889
}
1890+
1891+
18851892
}
18861893

18871894
protected function createContainer(array $data = [])

src/Symfony/Component/Notifier/Bridge/ABridge/.gitkeep

Whitespace-only changes.

0 commit comments

Comments
 (0)