@@ -445,6 +445,54 @@ public function testThrowIfCommandSetOnSendToRouter()
445445 $ driver ->sendToRouter ($ message );
446446 }
447447
448+ public function testShouldSendMessageToRouterProcessor ()
449+ {
450+ $ queue = $ this ->createQueue ('' );
451+ $ transportMessage = $ this ->createMessage ();
452+
453+ $ producer = $ this ->createProducerMock ();
454+ $ producer
455+ ->expects ($ this ->once ())
456+ ->method ('send ' )
457+ ->with ($ this ->identicalTo ($ queue ), $ this ->identicalTo ($ transportMessage ))
458+ ;
459+ $ context = $ this ->createContextMock ();
460+ $ context
461+ ->expects ($ this ->once ())
462+ ->method ('createQueue ' )
463+ ->with ($ this ->getDefaultQueueTransportName ())
464+ ->willReturn ($ queue )
465+ ;
466+ $ context
467+ ->expects ($ this ->once ())
468+ ->method ('createProducer ' )
469+ ->willReturn ($ producer )
470+ ;
471+ $ context
472+ ->expects ($ this ->once ())
473+ ->method ('createMessage ' )
474+ ->willReturn ($ transportMessage )
475+ ;
476+
477+ $ config = $ this ->createDummyConfig ();
478+
479+ $ driver = $ this ->createDriver (
480+ $ context ,
481+ $ config ,
482+ new RouteCollection ([
483+ new Route ('topic ' , Route::TOPIC , 'processor ' , [
484+ 'queue ' => 'custom ' ,
485+ ]),
486+ ])
487+ );
488+
489+ $ message = new Message ();
490+ $ message ->setProperty (Config::TOPIC , 'topic ' );
491+ $ message ->setProperty (Config::PROCESSOR , $ config ->getRouterProcessor ());
492+
493+ $ driver ->sendToProcessor ($ message );
494+ }
495+
448496 public function testShouldSendTopicMessageToProcessorToDefaultQueue ()
449497 {
450498 $ queue = $ this ->createQueue ('' );
0 commit comments