public function __construct(IRoleHierarchy $roleHierarchy, $prefix = 'ROLE_') { parent::__construct($prefix); $this->roleHierarchy = $roleHierarchy; }
public function testVote_usingIRole_noThrow() { $identity = \Mockery::mock(IIdentity::class)->shouldReceive('getRoles')->andReturn([$this->createRole('CLIENT')])->getMock(); $vote = $this->voter->vote($identity, [$this->createRole('ADMIN'), $this->createRole('MANAGER')], null); $this->assertEquals(IVoter::VOTE_DENIED, $vote); }