From 8eb6b82dcd93d3d94784a21a630b936f4445ee75 Mon Sep 17 00:00:00 2001 From: Christian Flothmann Date: Mon, 16 Jun 2025 12:08:56 +0200 Subject: [PATCH] fix test --- .../Messenger/Tests/Command/ConsumeMessagesCommandTest.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/Symfony/Component/Messenger/Tests/Command/ConsumeMessagesCommandTest.php b/src/Symfony/Component/Messenger/Tests/Command/ConsumeMessagesCommandTest.php index 3d9c33463b5ff..8552a64f1a291 100644 --- a/src/Symfony/Component/Messenger/Tests/Command/ConsumeMessagesCommandTest.php +++ b/src/Symfony/Component/Messenger/Tests/Command/ConsumeMessagesCommandTest.php @@ -255,7 +255,11 @@ public function log(...$args): void $command = new ConsumeMessagesCommand(new RoutableMessageBus($busLocator), $receiverLocator, new EventDispatcher(), $logger); $application = new Application(); - $application->add($command); + if (method_exists($application, 'addCommand')) { + $application->addCommand($command); + } else { + $application->add($command); + } $tester = new CommandTester($application->get('messenger:consume')); $tester->execute([ 'receivers' => ['dummy-receiver'],