eZ\Publish\Core\MVC\Symfony\Security\Tests\Voter\ValueObjectVoterTest::testVote PHP Method

testVote() public method

public testVote ( Attribute $attribute, $repositoryCanUser, $expectedResult )
$attribute eZ\Publish\Core\MVC\Symfony\Security\Authorization\Attribute
    public function testVote(Attribute $attribute, $repositoryCanUser, $expectedResult)
    {
        $voter = new ValueObjectVoter($this->repository);
        $targets = isset($attribute->limitations['targets']) ? $attribute->limitations['targets'] : null;
        $this->repository->expects($this->once())->method('canUser')->with($attribute->module, $attribute->function, $attribute->limitations['valueObject'], $targets)->will($this->returnValue($repositoryCanUser));
        $this->assertSame($expectedResult, $voter->vote($this->getMock('Symfony\\Component\\Security\\Core\\Authentication\\Token\\TokenInterface'), new \stdClass(), array($attribute)));
    }