@@ -597,7 +597,7 @@ public function testDefaultAnonConsumerDefinition()
597597
598598 public function testFooRpcClientDefinition ()
599599 {
600- $ container = $ this ->getContainer ('test .yml ' );
600+ $ container = $ this ->getContainer ('rpc-clients .yml ' );
601601
602602 $ this ->assertTrue ($ container ->has ('old_sound_rabbit_mq.foo_client_rpc ' ));
603603 $ definition = $ container ->getDefinition ('old_sound_rabbit_mq.foo_client_rpc ' );
@@ -615,7 +615,7 @@ public function testFooRpcClientDefinition()
615615
616616 public function testDefaultRpcClientDefinition ()
617617 {
618- $ container = $ this ->getContainer ('test .yml ' );
618+ $ container = $ this ->getContainer ('rpc-clients .yml ' );
619619
620620 $ this ->assertTrue ($ container ->has ('old_sound_rabbit_mq.default_client_rpc ' ));
621621 $ definition = $ container ->getDefinition ('old_sound_rabbit_mq.default_client_rpc ' );
@@ -628,6 +628,26 @@ public function testDefaultRpcClientDefinition()
628628 ),
629629 $ definition ->getMethodCalls ()
630630 );
631+ $ this ->assertFalse ($ definition ->isLazy ());
632+ $ this ->assertEquals ('%old_sound_rabbit_mq.rpc_client.class% ' , $ definition ->getClass ());
633+ }
634+
635+ public function testLazyRpcClientDefinition ()
636+ {
637+ $ container = $ this ->getContainer ('rpc-clients.yml ' );
638+
639+ $ this ->assertTrue ($ container ->has ('old_sound_rabbit_mq.lazy_client_rpc ' ));
640+ $ definition = $ container ->getDefinition ('old_sound_rabbit_mq.lazy_client_rpc ' );
641+ $ this ->assertEquals ((string ) $ definition ->getArgument (0 ), 'old_sound_rabbit_mq.connection.default ' );
642+ $ this ->assertEquals ((string ) $ definition ->getArgument (1 ), 'old_sound_rabbit_mq.channel.lazy_client ' );
643+ $ this ->assertEquals (
644+ array (
645+ array ('initClient ' , array (true )),
646+ array ('setUnserializer ' , array ('unserialize ' ))
647+ ),
648+ $ definition ->getMethodCalls ()
649+ );
650+ $ this ->assertTrue ($ definition ->isLazy ());
631651 $ this ->assertEquals ('%old_sound_rabbit_mq.rpc_client.class% ' , $ definition ->getClass ());
632652 }
633653
0 commit comments