@@ -43,10 +43,11 @@ public function testShouldHaveExpectedOptions()
4343 $ command = new ProduceCommand ($ this ->createMock (ContainerInterface::class), 'default ' );
4444
4545 $ options = $ command ->getDefinition ()->getOptions ();
46- $ this ->assertCount (3 , $ options );
46+ $ this ->assertCount (4 , $ options );
4747 $ this ->assertArrayHasKey ('client ' , $ options );
4848 $ this ->assertArrayHasKey ('topic ' , $ options );
4949 $ this ->assertArrayHasKey ('command ' , $ options );
50+ $ this ->assertArrayHasKey ('header ' , $ options );
5051 }
5152
5253 public function testShouldHaveExpectedAttributes ()
@@ -141,14 +142,11 @@ public function testShouldSendEventToDefaultTransport()
141142
142143 public function testShouldSendCommandToDefaultTransport ()
143144 {
144- $ header = 'Content-Type: text/plain ' ;
145- $ payload = 'theMessage ' ;
146-
147145 $ producerMock = $ this ->createProducerMock ();
148146 $ producerMock
149147 ->expects ($ this ->once ())
150148 ->method ('sendCommand ' )
151- ->with ('theCommand ' , new Message ( $ payload , [], [ $ header ]) )
149+ ->with ('theCommand ' , ' theMessage ' )
152150 ;
153151 $ producerMock
154152 ->expects ($ this ->never ())
@@ -161,8 +159,7 @@ public function testShouldSendCommandToDefaultTransport()
161159
162160 $ tester = new CommandTester ($ command );
163161 $ tester ->execute ([
164- 'message ' => $ payload ,
165- '--header ' => $ header ,
162+ 'message ' => 'theMessage ' ,
166163 '--command ' => 'theCommand ' ,
167164 ]);
168165 }
0 commit comments