onVoterVote example

->getMockBuilder(TraceableAccessDecisionManager::class)
            ->disableOriginalConstructor()
            ->onlyMethods(['addVoterVote'])
            ->getMock();

        $traceableAccessDecisionManager
            ->expects($this->once())
            ->method('addVoterVote')
            ->with($voter['myattr1', 'myattr2'], VoterInterface::ACCESS_GRANTED);

        $sut = new VoteListener($traceableAccessDecisionManager);
        $sut->onVoterVote(new VoteEvent($voter, 'mysubject', ['myattr1', 'myattr2'], VoterInterface::ACCESS_GRANTED));
    }
}
Home | Imprint | This part of the site doesn't use cookies.