@@ -247,23 +247,20 @@ public function testRegistersTraceableBusesToCollector()
247
247
248
248
$ container = $ this ->getContainerBuilder ();
249
249
$ container ->register ('messenger.data_collector ' , $ dataCollector );
250
- $ container ->register ($ fooBusId = 'messenger.bus.foo ' , MessageBusInterface::class)->addTag ('messenger.bus ' , array ('name ' => 'foo ' ));
251
- $ container ->register ($ barBusId = 'messenger.bus.bar ' , MessageBusInterface::class)->addTag ('messenger.bus ' );
250
+ $ container ->register ($ fooBusId = 'messenger.bus.foo ' , MessageBusInterface::class)->addTag ('messenger.bus ' );
252
251
$ container ->setParameter ('kernel.debug ' , true );
253
252
254
253
(new MessengerPass ())->process ($ container );
255
254
256
255
$ this ->assertTrue ($ container ->hasDefinition ($ debuggedFooBusId = 'debug.traced. ' .$ fooBusId ));
257
256
$ this ->assertSame (array ($ fooBusId , null , 0 ), $ container ->getDefinition ($ debuggedFooBusId )->getDecoratedService ());
258
- $ this ->assertTrue ($ container ->hasDefinition ($ debuggedBarBusId = 'debug.traced. ' .$ barBusId ));
259
- $ this ->assertSame (array ($ barBusId , null , 0 ), $ container ->getDefinition ($ debuggedBarBusId )->getDecoratedService ());
260
- $ this ->assertEquals (array (array ('registerBus ' , array ('foo ' , new Reference ($ debuggedFooBusId ))), array ('registerBus ' , array ('messenger.bus.bar ' , new Reference ($ debuggedBarBusId )))), $ container ->getDefinition ('messenger.data_collector ' )->getMethodCalls ());
257
+ $ this ->assertEquals (array (array ('registerBus ' , array ($ fooBusId , new Reference ($ debuggedFooBusId )))), $ container ->getDefinition ('messenger.data_collector ' )->getMethodCalls ());
261
258
}
262
259
263
260
public function testRegistersMiddlewaresFromServices ()
264
261
{
265
262
$ container = $ this ->getContainerBuilder ();
266
- $ container ->register ($ fooBusId = 'messenger.bus.foo ' , MessageBusInterface::class)->setArgument (0 , array ())->addTag ('messenger.bus ' , array ( ' name ' => ' foo ' ) );
263
+ $ container ->register ($ fooBusId = 'messenger.bus.foo ' , MessageBusInterface::class)->setArgument (0 , array ())->addTag ('messenger.bus ' );
267
264
$ container ->register ('messenger.middleware.allow_no_handler ' , AllowNoHandlerMiddleware::class)->setAbstract (true );
268
265
$ container ->register (UselessMiddleware::class, UselessMiddleware::class);
269
266
@@ -283,7 +280,7 @@ public function testRegistersMiddlewaresFromServices()
283
280
public function testCannotRegistersAnUndefinedMiddleware ()
284
281
{
285
282
$ container = $ this ->getContainerBuilder ();
286
- $ container ->register ($ fooBusId = 'messenger.bus.foo ' , MessageBusInterface::class)->setArgument (0 , array ())->addTag ('messenger.bus ' , array ( ' name ' => ' foo ' ) );
283
+ $ container ->register ($ fooBusId = 'messenger.bus.foo ' , MessageBusInterface::class)->setArgument (0 , array ())->addTag ('messenger.bus ' );
287
284
$ container ->setParameter ($ middlewaresParameter = $ fooBusId .'.middlewares ' , array ('not_defined_middleware ' ));
288
285
289
286
(new MessengerPass ())->process ($ container );
0 commit comments