summaryrefslogtreecommitdiffstats
path: root/Core/Tests
diff options
context:
space:
mode:
authorFabien Potencier <fabien.potencier@gmail.com>2015-09-30 22:31:32 +0200
committerFabien Potencier <fabien.potencier@gmail.com>2015-09-30 22:31:32 +0200
commit3026c37b81a8839e6e6882f53a91a1a907cd8351 (patch)
tree9111151aae827161ccbe53e666d65c8b17f702f8 /Core/Tests
parentbd79c7984aac80e80b29d466863e5b5105d65150 (diff)
parent7e5bb9fc580f23c093090a80a4bfebbb9ad466cb (diff)
downloadsymfony-security-3026c37b81a8839e6e6882f53a91a1a907cd8351.zip
symfony-security-3026c37b81a8839e6e6882f53a91a1a907cd8351.tar.gz
symfony-security-3026c37b81a8839e6e6882f53a91a1a907cd8351.tar.bz2
feature #15899 [3.0][Security] Remove deprecated features (WouterJ)
This PR was merged into the 3.0-dev branch. Discussion ---------- [3.0][Security] Remove deprecated features | Q | A | ------------- | --- | Bug fix? | no | New feature? | no | BC breaks? | yes | Deprecations? | no | Tests pass? | yes | Fixed tickets | - | License | MIT | Doc PR | - Commits ------- c3c5989 Remove more tests 6f9e897 Remove AbstractVoter#isGranted() method 6b6de15 Removed supports{Attribute,Class}() methods
Diffstat (limited to 'Core/Tests')
-rw-r--r--Core/Tests/Authorization/AccessDecisionManagerTest.php36
-rw-r--r--Core/Tests/Authorization/Voter/AbstractVoterTest.php54
2 files changed, 0 insertions, 90 deletions
diff --git a/Core/Tests/Authorization/AccessDecisionManagerTest.php b/Core/Tests/Authorization/AccessDecisionManagerTest.php
index 08bbc58..9c23672 100644
--- a/Core/Tests/Authorization/AccessDecisionManagerTest.php
+++ b/Core/Tests/Authorization/AccessDecisionManagerTest.php
@@ -17,42 +17,6 @@ use Symfony\Component\Security\Core\Authorization\Voter\VoterInterface;
class AccessDecisionManagerTest extends \PHPUnit_Framework_TestCase
{
/**
- * @group legacy
- */
- public function testSupportsClass()
- {
- $manager = new AccessDecisionManager(array(
- $this->getVoterSupportsClass(true),
- $this->getVoterSupportsClass(false),
- ));
- $this->assertTrue($manager->supportsClass('FooClass'));
-
- $manager = new AccessDecisionManager(array(
- $this->getVoterSupportsClass(false),
- $this->getVoterSupportsClass(false),
- ));
- $this->assertFalse($manager->supportsClass('FooClass'));
- }
-
- /**
- * @group legacy
- */
- public function testSupportsAttribute()
- {
- $manager = new AccessDecisionManager(array(
- $this->getVoterSupportsAttribute(true),
- $this->getVoterSupportsAttribute(false),
- ));
- $this->assertTrue($manager->supportsAttribute('foo'));
-
- $manager = new AccessDecisionManager(array(
- $this->getVoterSupportsAttribute(false),
- $this->getVoterSupportsAttribute(false),
- ));
- $this->assertFalse($manager->supportsAttribute('foo'));
- }
-
- /**
* @expectedException \InvalidArgumentException
*/
public function testSetUnsupportedStrategy()
diff --git a/Core/Tests/Authorization/Voter/AbstractVoterTest.php b/Core/Tests/Authorization/Voter/AbstractVoterTest.php
index 7062d39..aafef5a 100644
--- a/Core/Tests/Authorization/Voter/AbstractVoterTest.php
+++ b/Core/Tests/Authorization/Voter/AbstractVoterTest.php
@@ -54,27 +54,6 @@ class AbstractVoterTest extends \PHPUnit_Framework_TestCase
$this->assertEquals($expectedVote, $voter->vote($this->token, $object, $attributes), $message);
}
-
- /**
- * @dataProvider getTests
- * @group legacy
- */
- public function testVoteLegacy(array $attributes, $expectedVote, $object, $message)
- {
- $voter = new AbstractVoterTest_LegacyVoter();
-
- $this->assertEquals($expectedVote, $voter->vote($this->token, $object, $attributes), $message);
- }
-
- /**
- * @group legacy
- * @expectedException \BadMethodCallException
- */
- public function testNoOverriddenMethodsThrowsException()
- {
- $voter = new AbstractVoterTest_NothingImplementedVoter();
- $voter->vote($this->token, new \stdClass(), array('EDIT'));
- }
}
class AbstractVoterTest_Voter extends AbstractVoter
@@ -90,36 +69,3 @@ class AbstractVoterTest_Voter extends AbstractVoter
&& in_array($attribute, array('EDIT', 'CREATE'));
}
}
-
-class AbstractVoterTest_LegacyVoter extends AbstractVoter
-{
- protected function getSupportedClasses()
- {
- return array('stdClass');
- }
-
- protected function getSupportedAttributes()
- {
- return array('EDIT', 'CREATE');
- }
-
- protected function isGranted($attribute, $object, $user = null)
- {
- return 'EDIT' === $attribute;
- }
-}
-
-class AbstractVoterTest_NothingImplementedVoter extends AbstractVoter
-{
- protected function getSupportedClasses()
- {
- return array('stdClass');
- }
-
- protected function getSupportedAttributes()
- {
- return array('EDIT', 'CREATE');
- }
-
- // this is a bad voter that hasn't overridden isGranted or voteOnAttribute
-}