/**
* @dataProvider voteProvider
*/
public function testVote(Attribute $attribute, $repositoryCanUser, $expectedResult)
{
$voter = new CoreVoter($this->repository);
if ($repositoryCanUser !== null) {
$this->repository->expects($this->once())->method('hasAccess')->with($attribute->module, $attribute->function)->will($this->returnValue($repositoryCanUser));
} else {
$this->repository->expects($this->never())->method('hasAccess');
}
$this->assertSame($expectedResult, $voter->vote($this->getMock('Symfony\\Component\\Security\\Core\\Authentication\\Token\\TokenInterface'), new \stdClass(), array($attribute)));
}