From 9fe3b7697b00022ba1af6df3690b8cd1faf770b0 Mon Sep 17 00:00:00 2001 From: Christian Flothmann Date: Mon, 28 Sep 2015 16:57:37 +0200 Subject: [PATCH] fix tests for the `AbstractVoter` class * The `LegacyAbstractVoterTest` class is not needed anymore, tests have been moved to the `AbstractVoterTest` class tagging them with the legacy group. * Tests are applied on `stdClass` object instances. Thus, the legacy voter fixture class must not support `AbstractVoterTest_Object` instances, but support `stdClass` objects instead. --- .../Authorization/Voter/AbstractVoterTest.php | 4 +- .../Voter/LegacyAbstractVoterTest.php | 42 ------------------- 2 files changed, 2 insertions(+), 44 deletions(-) delete mode 100644 src/Symfony/Component/Security/Core/Tests/Authorization/Voter/LegacyAbstractVoterTest.php diff --git a/src/Symfony/Component/Security/Core/Tests/Authorization/Voter/AbstractVoterTest.php b/src/Symfony/Component/Security/Core/Tests/Authorization/Voter/AbstractVoterTest.php index 0fddd88b03..7062d3983b 100644 --- a/src/Symfony/Component/Security/Core/Tests/Authorization/Voter/AbstractVoterTest.php +++ b/src/Symfony/Component/Security/Core/Tests/Authorization/Voter/AbstractVoterTest.php @@ -95,7 +95,7 @@ class AbstractVoterTest_LegacyVoter extends AbstractVoter { protected function getSupportedClasses() { - return array('AbstractVoterTest_Object'); + return array('stdClass'); } protected function getSupportedAttributes() @@ -113,7 +113,7 @@ class AbstractVoterTest_NothingImplementedVoter extends AbstractVoter { protected function getSupportedClasses() { - return array('AbstractVoterTest_Object'); + return array('stdClass'); } protected function getSupportedAttributes() diff --git a/src/Symfony/Component/Security/Core/Tests/Authorization/Voter/LegacyAbstractVoterTest.php b/src/Symfony/Component/Security/Core/Tests/Authorization/Voter/LegacyAbstractVoterTest.php deleted file mode 100644 index b49f23f5bb..0000000000 --- a/src/Symfony/Component/Security/Core/Tests/Authorization/Voter/LegacyAbstractVoterTest.php +++ /dev/null @@ -1,42 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -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(); - } -}