@@ -34,48 +34,6 @@ public function testStrategies($strategy, $voters, $allowIfAllAbstainDecisions,
34
34
$ this ->assertSame ($ expected , $ manager ->decide ($ token , ['ROLE_FOO ' ]));
35
35
}
36
36
37
- /**
38
- * @dataProvider getStrategiesWith2RolesTests
39
- */
40
- public function testLegacyStrategiesWith2Roles ($ token , $ strategy , $ voter , $ expected )
41
- {
42
- $ manager = new AccessDecisionManager ([$ voter ], $ strategy );
43
-
44
- $ this ->assertSame ($ expected , $ manager ->decide ($ token , ['ROLE_FOO ' , 'ROLE_BAR ' ]));
45
- }
46
-
47
- public function getStrategiesWith2RolesTests ()
48
- {
49
- $ token = $ this ->getMockBuilder ('Symfony\Component\Security\Core\Authentication\Token\TokenInterface ' )->getMock ();
50
-
51
- return [
52
- [$ token , 'affirmative ' , $ this ->getVoter (VoterInterface::ACCESS_DENIED ), false ],
53
- [$ token , 'affirmative ' , $ this ->getVoter (VoterInterface::ACCESS_GRANTED ), true ],
54
-
55
- [$ token , 'consensus ' , $ this ->getVoter (VoterInterface::ACCESS_DENIED ), false ],
56
- [$ token , 'consensus ' , $ this ->getVoter (VoterInterface::ACCESS_GRANTED ), true ],
57
-
58
- [$ token , 'unanimous ' , $ this ->getVoterFor2Roles ($ token , VoterInterface::ACCESS_DENIED , VoterInterface::ACCESS_DENIED ), false ],
59
- [$ token , 'unanimous ' , $ this ->getVoterFor2Roles ($ token , VoterInterface::ACCESS_DENIED , VoterInterface::ACCESS_GRANTED ), false ],
60
- [$ token , 'unanimous ' , $ this ->getVoterFor2Roles ($ token , VoterInterface::ACCESS_GRANTED , VoterInterface::ACCESS_DENIED ), false ],
61
- [$ token , 'unanimous ' , $ this ->getVoterFor2Roles ($ token , VoterInterface::ACCESS_GRANTED , VoterInterface::ACCESS_GRANTED ), true ],
62
- ];
63
- }
64
-
65
- protected function getVoterFor2Roles ($ token , $ vote1 , $ vote2 )
66
- {
67
- $ voter = $ this ->getMockBuilder ('Symfony\Component\Security\Core\Authorization\Voter\VoterInterface ' )->getMock ();
68
- $ voter ->expects ($ this ->any ())
69
- ->method ('vote ' )
70
- ->willReturnMap ([
71
- [$ token , null , ['ROLE_FOO ' ], $ vote1 ],
72
- [$ token , null , ['ROLE_BAR ' ], $ vote2 ],
73
- ])
74
- ;
75
-
76
- return $ voter ;
77
- }
78
-
79
37
public function getStrategyTests ()
80
38
{
81
39
return [
0 commit comments