@@ -43,10 +43,11 @@ public function testShouldHaveExpectedOptions()
43
43
$ command = new ProduceCommand ($ this ->createMock (ContainerInterface::class), 'default ' );
44
44
45
45
$ options = $ command ->getDefinition ()->getOptions ();
46
- $ this ->assertCount (3 , $ options );
46
+ $ this ->assertCount (4 , $ options );
47
47
$ this ->assertArrayHasKey ('client ' , $ options );
48
48
$ this ->assertArrayHasKey ('topic ' , $ options );
49
49
$ this ->assertArrayHasKey ('command ' , $ options );
50
+ $ this ->assertArrayHasKey ('header ' , $ options );
50
51
}
51
52
52
53
public function testShouldHaveExpectedAttributes ()
@@ -141,14 +142,11 @@ public function testShouldSendEventToDefaultTransport()
141
142
142
143
public function testShouldSendCommandToDefaultTransport ()
143
144
{
144
- $ header = 'Content-Type: text/plain ' ;
145
- $ payload = 'theMessage ' ;
146
-
147
145
$ producerMock = $ this ->createProducerMock ();
148
146
$ producerMock
149
147
->expects ($ this ->once ())
150
148
->method ('sendCommand ' )
151
- ->with ('theCommand ' , new Message ( $ payload , [], [ $ header ]) )
149
+ ->with ('theCommand ' , ' theMessage ' )
152
150
;
153
151
$ producerMock
154
152
->expects ($ this ->never ())
@@ -161,8 +159,7 @@ public function testShouldSendCommandToDefaultTransport()
161
159
162
160
$ tester = new CommandTester ($ command );
163
161
$ tester ->execute ([
164
- 'message ' => $ payload ,
165
- '--header ' => $ header ,
162
+ 'message ' => 'theMessage ' ,
166
163
'--command ' => 'theCommand ' ,
167
164
]);
168
165
}
0 commit comments