summaryrefslogtreecommitdiffstats
path: root/Core/Tests/Authorization
diff options
context:
space:
mode:
Diffstat (limited to 'Core/Tests/Authorization')
-rw-r--r--Core/Tests/Authorization/AccessDecisionManagerTest.php6
-rw-r--r--Core/Tests/Authorization/Voter/AbstractVoterTest.php2
-rw-r--r--Core/Tests/Authorization/Voter/LegacyAbstractVoterTest.php33
3 files changed, 40 insertions, 1 deletions
diff --git a/Core/Tests/Authorization/AccessDecisionManagerTest.php b/Core/Tests/Authorization/AccessDecisionManagerTest.php
index bd876c7..08bbc58 100644
--- a/Core/Tests/Authorization/AccessDecisionManagerTest.php
+++ b/Core/Tests/Authorization/AccessDecisionManagerTest.php
@@ -16,6 +16,9 @@ use Symfony\Component\Security\Core\Authorization\Voter\VoterInterface;
class AccessDecisionManagerTest extends \PHPUnit_Framework_TestCase
{
+ /**
+ * @group legacy
+ */
public function testSupportsClass()
{
$manager = new AccessDecisionManager(array(
@@ -31,6 +34,9 @@ class AccessDecisionManagerTest extends \PHPUnit_Framework_TestCase
$this->assertFalse($manager->supportsClass('FooClass'));
}
+ /**
+ * @group legacy
+ */
public function testSupportsAttribute()
{
$manager = new AccessDecisionManager(array(
diff --git a/Core/Tests/Authorization/Voter/AbstractVoterTest.php b/Core/Tests/Authorization/Voter/AbstractVoterTest.php
index 4e38fd6..44da147 100644
--- a/Core/Tests/Authorization/Voter/AbstractVoterTest.php
+++ b/Core/Tests/Authorization/Voter/AbstractVoterTest.php
@@ -98,7 +98,7 @@ class DeprecatedVoterFixture extends AbstractVoter
protected function getSupportedClasses()
{
return array(
- 'Symfony\Component\Security\Tests\Core\Authentication\Voter\ObjectFixture',
+ 'Symfony\Component\Security\Core\Tests\Authorization\Voter\ObjectFixture',
);
}
diff --git a/Core/Tests/Authorization/Voter/LegacyAbstractVoterTest.php b/Core/Tests/Authorization/Voter/LegacyAbstractVoterTest.php
new file mode 100644
index 0000000..3a0cf1e
--- /dev/null
+++ b/Core/Tests/Authorization/Voter/LegacyAbstractVoterTest.php
@@ -0,0 +1,33 @@
+<?php
+
+namespace Symfony\Component\Security\Core\Tests\Authorization\Voter;
+
+use Symfony\Component\Security\Core\Authorization\Voter\AbstractVoter;
+
+class LegacyAbstractVoterTest_Voter extends AbstractVoter
+{
+ protected function getSupportedClasses()
+ {
+ return array('AbstractVoterTest_Object');
+ }
+
+ protected function getSupportedAttributes()
+ {
+ return array('EDIT', 'CREATE');
+ }
+
+ protected function isGranted($attribute, $object, $user = null)
+ {
+ return 'EDIT' === $attribute;
+ }
+}
+
+class LegacyAbstractVoterTest extends AbstractVoterTest
+{
+ protected function setUp()
+ {
+ parent::setUp();
+
+ $this->voter = new LegacyAbstractVoterTest_Voter();
+ }
+}