$privatePool =
new Definition();
$privatePool->
addArgument('namespace'
);
$privatePool->
addTag('cache.pool',
['clearer' => 'clearer_alias'
]);
$container->
setDefinition('private.pool',
$privatePool);
$clearer =
new Definition();
$clearer->
setPublic(true
);
$container->
setDefinition('clearer',
$clearer);
$container->
setAlias('clearer_alias', 'clearer'
);
$pass =
new RemoveUnusedDefinitionsPass();
foreach ([new CachePoolPass(),
$pass,
new CachePoolClearerPass()] as $pass) { $pass->
process($container);
} $expected =
[[ 'public.pool' =>
new Reference('public.pool'
),
'pool2' =>
new Reference('public.pool2'
),
]];
$this->
assertEquals($expected,
$clearer->
getArguments());
$this->
assertEquals($expected,
$globalClearer->
getArguments());
}}