public function __construct(RoleHierarchyInterface $roleHierarchy, $prefix = 'ROLE_') { $this->roleHierarchy = $roleHierarchy; parent::__construct($prefix); }
/** * @dataProvider getVoteTests */ public function testVote($roles, $attributes, $expected) { $voter = new RoleVoter(); $this->assertSame($expected, $voter->vote($this->getToken($roles), null, $attributes)); }
/** * @param RoleCollection $roleCollection * @param string $prefix */ public function __construct(RoleCollection $roleCollection, $prefix = 'ROLE_') { parent::__construct($prefix); $this->roleCollection = $roleCollection; }