Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 4e0f034

Browse filesBrowse files
committed
remove tests for legacy behavior
1 parent ec2afb7 commit 4e0f034
Copy full SHA for 4e0f034

File tree

1 file changed

+0
-42
lines changed
Filter options

1 file changed

+0
-42
lines changed

‎src/Symfony/Component/Security/Core/Tests/Authorization/AccessDecisionManagerTest.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Security/Core/Tests/Authorization/AccessDecisionManagerTest.php
-42Lines changed: 0 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -34,48 +34,6 @@ public function testStrategies($strategy, $voters, $allowIfAllAbstainDecisions,
3434
$this->assertSame($expected, $manager->decide($token, ['ROLE_FOO']));
3535
}
3636

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-
7937
public function getStrategyTests()
8038
{
8139
return [

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.