8000 [Messenger][FrameworkBundle] Fix xml configuration of messenger routing · symfony/symfony@a38953b · GitHub
[go: up one dir, main page]

Skip to content

Commit a38953b

Browse files
committed
[Messenger][FrameworkBundle] Fix xml configuration of messenger routing
1 parent 5440d67 commit a38953b

File tree

4 files changed

+7
-8
lines changed

4 files changed

+7
-8
lines changed

src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Configuration.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1147,6 +1147,7 @@ private function addMessengerSection(ArrayNodeDefinition $rootNode)
11471147
->ifTrue(function ($v) { return isset($v['buses']) && \count($v['buses']) > 1 && null === $v['default_bus']; })
11481148
->thenInvalid('You must specify the "default_bus" if you define more than one bus.')
11491149
->end()
1150+
->fixXmlConfig('routing', 'routing')
11501151
->children()
11511152
->arrayNode('routing')
11521153
->normalizeKeys(false)

src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1793,7 +1793,7 @@ private function registerMessengerConfiguration(array $config, ContainerBuilder
17931793
// make sure senderAliases contains all senders
17941794
foreach ($messageConfiguration['senders'] as $sender) {
17951795
if (!isset($senderReferences[$sender])) {
1796-
throw new LogicException(sprintf('Invalid Messenger routing configuration: the "%s" class is being routed to a sender called "%s". This is not a valid transport or service id.' 8000 , $message, $sender));
1796+
throw new LogicException(sprintf('Invalid Messenger routing configuration: the "%s" class is being routed to a sender called "%s". This is not a valid transport or service ID.', $message, $sender));
17971797
}
17981798
}
17991799

src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/xml/messenger_routing_invalid_transport.xml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,6 @@
1212
<framework:routing message-class="Symfony\Bundle\FrameworkBundle\Tests\Fixtures\Messenger\DummyMessage">
1313
<framework:sender service="invalid" />
1414
</framework:routing>
15-
<framework:routing message-class="Symfony\Bundle\FrameworkBundle\Tests\Fixtures\Messenger\SecondMessage">
16-
<framework:sender service="amqp" />
17-
<framework:sender service="audit" />
18-
</framework:routing>
1915
<framework:transport name="amqp" dsn="amqp://localhost/%2f/messages" />
2016
</framework:messenger>
2117
</framework:config>

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

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@
3333
use Symfony\Component\DependencyInjection\ContainerBuilder;
3434
use Symfony\Component\DependencyInjection\ContainerInterface;
3535
use Symfony\Component\DependencyInjection\Definition;
36+
use Symfony\Component\DependencyInjection\Exception\InvalidArgumentException;
37+
use Symfony\Component\DependencyInjection\Exception\LogicException;
3638
use Symfony\Component\DependencyInjection\Loader\ClosureLoader;
3739
use Symfony\Component\DependencyInjection\ParameterBag\ParameterBag;
3840
use Symfony\Component\DependencyInjection\Reference;
@@ -768,15 +770,15 @@ public function testMessengerWithMultipleBuses()
768770

769771
public function testMessengerMiddlewareFactoryErroneousFormat()
770772
{
771-
$this->expectException('InvalidArgumentException');
773+
$this->expectException(InvalidArgumentException::class);
772774
$this->expectExceptionMessage('Invalid middleware at path "framework.messenger": a map with a single factory id as key and its arguments as value was expected, {"foo":["qux"],"bar":["baz"]} given.');
773775
$this->createContainerFromFile('messenger_middleware_factory_erroneous_format');
774776
}
775777

776778
public function testMessengerInvalidTransportRouting()
777779
{
778-
$this->expectException('LogicException');
779-
$this->expectExceptionMessage('Invalid Messenger routing configuration: the "Symfony\Bundle\FrameworkBundle\Tests\Fixtures\Messenger\DummyMessage" class is being routed to a sender called "invalid". This is not a valid transport or service id.');
780+
$this->expectException(LogicException::class);
781+
$this->expectExceptionMessage('Invalid Messenger routing configuration: the "Symfony\Bundle\FrameworkBundle\Tests\Fixtures\Messenger\DummyMessage" class is being routed to a sender called "invalid". This is not a valid transport or service ID.');
780782
$this->createContainerFromFile('messenger_routing_invalid_transport');
781783
}
782784

0 commit comments

Comments
 (0)
0