use Symfony\Component\Security\Core\Authorization\Voter\AuthenticatedVoter;
use Symfony\Component\Security\Core\Authorization\Voter\VoterInterface;
use Symfony\Component\Security\Core\User\InMemoryUser;
class AuthenticatedVoterTest extends TestCase
{ /**
* @dataProvider getVoteTests
*/
public function testVote($authenticated,
$attributes,
$expected) { $voter =
new AuthenticatedVoter(new AuthenticationTrustResolver());
$this->
assertSame($expected,
$voter->
vote($this->
getToken($authenticated), null,
$attributes));
} public static function getVoteTests() { return [ ['fully',
[], VoterInterface::ACCESS_ABSTAIN
],
['fully',
['FOO'
], VoterInterface::ACCESS_ABSTAIN
],
['remembered',
[], VoterInterface::ACCESS_ABSTAIN
],
['remembered',
['FOO'
], VoterInterface::ACCESS_ABSTAIN
],
[