$container =
new ContainerBuilder();
$definition =
$container->
register(NamedArgumentsDummy::
class, NamedArgumentsDummy::
class);
$definition->
setArguments([ 2 => 'http://api.example.com',
'$apiKey' => '123',
0 =>
new Reference('foo'
),
]);
$definition->
addMethodCall('setApiKey',
['$apiKey' => '123'
]);
$pass =
new ResolveNamedArgumentsPass();
$pass->
process($container);
$this->
assertEquals([0 =>
new Reference('foo'
), 1 => '123', 2 => 'http://api.example.com'
],
$definition->
getArguments());
$this->
assertEquals([['setApiKey',
['123'
]]],
$definition->
getMethodCalls());
} public function testWithFactory() { $container =
new ContainerBuilder();
$container->
register('factory', NoConstructor::
class);