$this->
assertTrue($container->
getAlias('messenger.default_bus'
)->
isPublic());
$this->
assertTrue($container->
hasDefinition('messenger.transport_factory'
));
$this->
assertSame(TransportFactory::
class,
$container->
getDefinition('messenger.transport_factory'
)->
getClass());
$this->
assertInstanceOf(TaggedIteratorArgument::
class,
$container->
getDefinition('messenger.transport_factory'
)->
getArgument(0
));
$this->
assertEquals($expectedFactories,
$container->
getDefinition('messenger.transport_factory'
)->
getArgument(0
)->
getValues());
$this->
assertTrue($container->
hasDefinition('messenger.listener.reset_services'
));
$this->
assertSame('messenger.listener.reset_services',
(string) $container->
getDefinition('console.command.messenger_consume_messages'
)->
getArgument(5
));
} public function testMessengerWithoutConsole() { $extension =
$this->
createPartialMock(FrameworkExtension::
class,
['hasConsole', 'getAlias'
]);
$extension->
method('hasConsole'
)->
willReturn(false
);
$extension->
method('getAlias'
)->
willReturn((new FrameworkExtension())->
getAlias());
$container =
$this->
createContainerFromFile('messenger',
[], true, false,
$extension);
$container->
compile();
$this->
assertFalse($container->
hasDefinition('console.command.messenger_consume_messages'
));
$this->
assertTrue($container->
hasAlias('messenger.default_bus'
));
$this->
assertTrue($container->
getAlias('messenger.default_bus'
)->
isPublic());
$this->
assertTrue($container->
hasDefinition('messenger.transport_factory'
));
$this->
assertFalse($container->
hasDefinition('messenger.listener.reset_services'
));
}