$container->
register('middleware_with_factory_using_default', UselessMiddleware::
class)->
addArgument('some_default'
)->
setAbstract(true
);
$container->
register(UselessMiddleware::
class, UselessMiddleware::
class);
$container->
setParameter($middlewareParameter =
$fooBusId.'.middleware',
[ ['id' => UselessMiddleware::
class],
['id' => 'middleware_with_factory', 'arguments' =>
$factoryChildMiddlewareArgs1 =
['index_0' => 'foo', 'bar'
]],
['id' => 'middleware_with_factory', 'arguments' =>
$factoryChildMiddlewareArgs2 =
['index_0' => 'baz'
]],
['id' => 'middleware_with_factory_using_default'
],
]);
(new MessengerPass())->
process($container);
(new ResolveChildDefinitionsPass())->
process($container);
$this->
assertTrue($container->
hasDefinition( $factoryChildMiddlewareArgs1Id =
$fooBusId.'.middleware.middleware_with_factory'
));
$this->
assertEquals( ['foo', 'bar'
],
$container->
getDefinition($factoryChildMiddlewareArgs1Id)->
getArguments(),
'parent default argument is overridden, and next ones appended'
);
$this->
assertTrue($container->
hasDefinition(