$container->
setDefinition('voter2',
$voterDef2);
$container ->
register('security.access.decision_manager', AccessDecisionManager::
class) ->
addArgument([$voterDef1,
$voterDef2]);
$container->
setParameter('kernel.debug', true
);
$compilerPass =
new AddSecurityVotersPass();
$compilerPass->
process($container);
$def1 =
$container->
getDefinition('.debug.security.voter.voter1'
);
$this->
assertNull($def1->
getDecoratedService(), 'voter1: should not be decorated'
);
$this->
assertEquals(new Reference('voter1'
),
$def1->
getArgument(0
), 'voter1: wrong argument'
);
$def2 =
$container->
getDefinition('.debug.security.voter.voter2'
);
$this->
assertNull($def2->
getDecoratedService(), 'voter2: should not be decorated'
);
$this->
assertEquals(new Reference('voter2'
),
$def2->
getArgument(0
), 'voter2: wrong argument'
);
$voters =
$container->
findTaggedServiceIds('security.voter'
);
$this->
assertCount(2,
$voters, 'Incorrect count of voters'
);
} public function testThatVotersAreNotTraceableWithoutDebugMode() {