public function setVoters(array $voters) { if (!count($voters)) { throw new \LogicException('You must have at least one voter.'); } $this->voters = array(); foreach ($voters as $voter) { $this->addVoter($voter); } }
public function testSetVoters() { $manager = new AccessDecisionManager(); $manager->setVoters(array($voter = $this->getVoterSupportsAttribute(true))); $this->assertSame(array($voter), $manager->getVoters()); }