diff --git a/src/Symfony/Bundle/SecurityBundle/Tests/DataCollector/SecurityDataCollectorTest.php b/src/Symfony/Bundle/SecurityBundle/Tests/DataCollector/SecurityDataCollectorTest.php index 72a41bc122..cf2f561503 100644 --- a/src/Symfony/Bundle/SecurityBundle/Tests/DataCollector/SecurityDataCollectorTest.php +++ b/src/Symfony/Bundle/SecurityBundle/Tests/DataCollector/SecurityDataCollectorTest.php @@ -40,24 +40,6 @@ class SecurityDataCollectorTest extends \PHPUnit_Framework_TestCase $this->assertEmpty($collector->getUser()); } - /** - * @group legacy - */ - public function testLegacyCollectWhenAuthenticationTokenIsNull() - { - $tokenStorage = $this->getMock('Symfony\Component\Security\Core\SecurityContextInterface'); - $collector = new SecurityDataCollector($tokenStorage, $this->getRoleHierarchy()); - $collector->collect($this->getRequest(), $this->getResponse()); - - $this->assertTrue($collector->isEnabled()); - $this->assertFalse($collector->isAuthenticated()); - $this->assertNull($collector->getTokenClass()); - $this->assertTrue($collector->supportsRoleHierarchy()); - $this->assertCount(0, $collector->getRoles()); - $this->assertCount(0, $collector->getInheritedRoles()); - $this->assertEmpty($collector->getUser()); - } - /** @dataProvider provideRoles */ public function testCollectAuthenticationTokenAndRoles(array $roles, array $normalizedRoles, array $inheritedRoles) { diff --git a/src/Symfony/Component/Security/CHANGELOG.md b/src/Symfony/Component/Security/CHANGELOG.md index 0728da9bdb..b444d4d63e 100644 --- a/src/Symfony/Component/Security/CHANGELOG.md +++ b/src/Symfony/Component/Security/CHANGELOG.md @@ -1,6 +1,11 @@ CHANGELOG ========= +3.0.0 +----- + + * removed all deprecated codes from 2.x versions + 2.8.0 ----- diff --git a/src/Symfony/Component/Security/Core/Authentication/SimpleFormAuthenticatorInterface.php b/src/Symfony/Component/Security/Core/Authentication/SimpleFormAuthenticatorInterface.php deleted file mode 100644 index ae2b58b19f..0000000000 --- a/src/Symfony/Component/Security/Core/Authentication/SimpleFormAuthenticatorInterface.php +++ /dev/null @@ -1,24 +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\Authentication; - -use Symfony\Component\HttpFoundation\Request; - -/** - * @deprecated Deprecated since version 2.8, to be removed in 3.0. Use the same interface from Security\Http\Authentication instead. - * - * @author Jordi Boggiano - */ -interface SimpleFormAuthenticatorInterface extends SimpleAuthenticatorInterface -{ - public function createToken(Request $request, $username, $password, $providerKey); -} diff --git a/src/Symfony/Component/Security/Core/Authentication/SimplePreAuthenticatorInterface.php b/src/Symfony/Component/Security/Core/Authentication/SimplePreAuthenticatorInterface.php deleted file mode 100644 index c01f064765..0000000000 --- a/src/Symfony/Component/Security/Core/Authentication/SimplePreAuthenticatorInterface.php +++ /dev/null @@ -1,24 +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\Authentication; - -use Symfony\Component\HttpFoundation\Request; - -/** - * @deprecated Since version 2.8, to be removed in 3.0. Use the same interface from Security\Http\Authentication instead. - * - * @author Jordi Boggiano - */ -interface SimplePreAuthenticatorInterface extends SimpleAuthenticatorInterface -{ - public function createToken(Request $request, $providerKey); -} diff --git a/src/Symfony/Component/Security/Core/Authentication/Token/AnonymousToken.php b/src/Symfony/Component/Security/Core/Authentication/Token/AnonymousToken.php index 22fc611b2a..e1dfef4823 100644 --- a/src/Symfony/Component/Security/Core/Authentication/Token/AnonymousToken.php +++ b/src/Symfony/Component/Security/Core/Authentication/Token/AnonymousToken.php @@ -46,16 +46,6 @@ class AnonymousToken extends AbstractToken return ''; } - /** - * @deprecated Since version 2.8, to be removed in 3.0. Use getSecret() instead. - */ - public function getKey() - { - @trigger_error(__method__.'() is deprecated since version 2.8 and will be removed in 3.0. Use getSecret() instead.', E_USER_DEPRECATED); - - return $this->getSecret(); - } - /** * Returns the secret. * diff --git a/src/Symfony/Component/Security/Core/Authentication/Token/RememberMeToken.php b/src/Symfony/Component/Security/Core/Authentication/Token/RememberMeToken.php index 60e36f2990..edd77abbb1 100644 --- a/src/Symfony/Component/Security/Core/Authentication/Token/RememberMeToken.php +++ b/src/Symfony/Component/Security/Core/Authentication/Token/RememberMeToken.php @@ -73,16 +73,6 @@ class RememberMeToken extends AbstractToken return $this->providerKey; } - /** - * @deprecated Since version 2.8, to be removed in 3.0. Use getSecret() instead. - */ - public function getKey() - { - @trigger_error(__method__.'() is deprecated since version 2.8 and will be removed in 3.0. Use getSecret() instead.', E_USER_DEPRECATED); - - return $this->getSecret(); - } - /** * Returns the secret. * diff --git a/src/Symfony/Component/Security/Core/SecurityContext.php b/src/Symfony/Component/Security/Core/SecurityContext.php deleted file mode 100644 index 027ff49480..0000000000 --- a/src/Symfony/Component/Security/Core/SecurityContext.php +++ /dev/null @@ -1,104 +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; - -@trigger_error('The '.__NAMESPACE__.'\SecurityContext class is deprecated since version 2.6 and will be removed in 3.0. Use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorage or Symfony\Component\Security\Core\Authorization\AuthorizationChecker instead.', E_USER_DEPRECATED); - -use Symfony\Component\Security\Core\Authentication\AuthenticationManagerInterface; -use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorage; -use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface; -use Symfony\Component\Security\Core\Authentication\Token\TokenInterface; -use Symfony\Component\Security\Core\Authorization\AccessDecisionManagerInterface; -use Symfony\Component\Security\Core\Authorization\AuthorizationChecker; -use Symfony\Component\Security\Core\Authorization\AuthorizationCheckerInterface; - -/** - * SecurityContext is the main entry point of the Security component. - * - * It gives access to the token representing the current user authentication. - * - * @author Fabien Potencier - * @author Johannes M. Schmitt - * - * @deprecated since version 2.6, to be removed in 3.0. - */ -class SecurityContext implements SecurityContextInterface -{ - /** - * @var TokenStorageInterface - */ - private $tokenStorage; - - /** - * @var AuthorizationCheckerInterface - */ - private $authorizationChecker; - - /** - * For backwards compatibility, the signature of sf <2.6 still works. - * - * @param TokenStorageInterface|AuthenticationManagerInterface $tokenStorage - * @param AuthorizationCheckerInterface|AccessDecisionManagerInterface $authorizationChecker - * @param bool $alwaysAuthenticate only applicable with old signature - */ - public function __construct($tokenStorage, $authorizationChecker, $alwaysAuthenticate = false) - { - $oldSignature = $tokenStorage instanceof AuthenticationManagerInterface && $authorizationChecker instanceof AccessDecisionManagerInterface; - $newSignature = $tokenStorage instanceof TokenStorageInterface && $authorizationChecker instanceof AuthorizationCheckerInterface; - - // confirm possible signatures - if (!$oldSignature && !$newSignature) { - throw new \BadMethodCallException('Unable to construct SecurityContext, please provide the correct arguments'); - } - - if ($oldSignature) { - // renamed for clarity - $authenticationManager = $tokenStorage; - $accessDecisionManager = $authorizationChecker; - $tokenStorage = new TokenStorage(); - $authorizationChecker = new AuthorizationChecker($tokenStorage, $authenticationManager, $accessDecisionManager, $alwaysAuthenticate); - } - - $this->tokenStorage = $tokenStorage; - $this->authorizationChecker = $authorizationChecker; - } - - /** - * @deprecated since version 2.6, to be removed in 3.0. Use TokenStorageInterface::getToken() instead. - * - * {@inheritdoc} - */ - public function getToken() - { - return $this->tokenStorage->getToken(); - } - - /** - * @deprecated since version 2.6, to be removed in 3.0. Use TokenStorageInterface::setToken() instead. - * - * {@inheritdoc} - */ - public function setToken(TokenInterface $token = null) - { - return $this->tokenStorage->setToken($token); - } - - /** - * @deprecated since version 2.6, to be removed in 3.0. Use AuthorizationCheckerInterface::isGranted() instead. - * - * {@inheritdoc} - */ - public function isGranted($attributes, $object = null) - { - return $this->authorizationChecker->isGranted($attributes, $object); - } -} diff --git a/src/Symfony/Component/Security/Core/SecurityContextInterface.php b/src/Symfony/Component/Security/Core/SecurityContextInterface.php deleted file mode 100644 index 2a06ca426a..0000000000 --- a/src/Symfony/Component/Security/Core/SecurityContextInterface.php +++ /dev/null @@ -1,29 +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; - -use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface; -use Symfony\Component\Security\Core\Authorization\AuthorizationCheckerInterface; - -/** - * The SecurityContextInterface. - * - * @author Johannes M. Schmitt - * - * @deprecated since version 2.6, to be removed in 3.0. - */ -interface SecurityContextInterface extends TokenStorageInterface, AuthorizationCheckerInterface -{ - const ACCESS_DENIED_ERROR = Security::ACCESS_DENIED_ERROR; - const AUTHENTICATION_ERROR = Security::AUTHENTICATION_ERROR; - const LAST_USERNAME = Security::LAST_USERNAME; -} diff --git a/src/Symfony/Component/Security/Core/Tests/LegacySecurityContextTest.php b/src/Symfony/Component/Security/Core/Tests/LegacySecurityContextTest.php deleted file mode 100644 index 92d7c163a7..0000000000 --- a/src/Symfony/Component/Security/Core/Tests/LegacySecurityContextTest.php +++ /dev/null @@ -1,122 +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; - -use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorage; -use Symfony\Component\Security\Core\Authorization\AuthorizationChecker; -use Symfony\Component\Security\Core\SecurityContext; - -/** - * @group legacy - */ -class LegacySecurityContextTest extends \PHPUnit_Framework_TestCase -{ - private $tokenStorage; - private $authorizationChecker; - private $securityContext; - - protected function setUp() - { - $this->tokenStorage = $this->getMock('Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface'); - $this->authorizationChecker = $this->getMock('Symfony\Component\Security\Core\Authorization\AuthorizationCheckerInterface'); - $this->securityContext = new SecurityContext($this->tokenStorage, $this->authorizationChecker); - } - - public function testGetTokenDelegation() - { - $token = $this->getMock('Symfony\Component\Security\Core\Authentication\Token\TokenInterface'); - - $this->tokenStorage - ->expects($this->once()) - ->method('getToken') - ->will($this->returnValue($token)); - - $this->assertTrue($token === $this->securityContext->getToken()); - } - - public function testSetTokenDelegation() - { - $token = $this->getMock('Symfony\Component\Security\Core\Authentication\Token\TokenInterface'); - - $this->tokenStorage - ->expects($this->once()) - ->method('setToken') - ->with($token); - - $this->securityContext->setToken($token); - } - - /** - * @dataProvider isGrantedDelegationProvider - */ - public function testIsGrantedDelegation($attributes, $object, $return) - { - $this->authorizationChecker - ->expects($this->once()) - ->method('isGranted') - ->with($attributes, $object) - ->will($this->returnValue($return)); - - $this->assertEquals($return, $this->securityContext->isGranted($attributes, $object)); - } - - public function isGrantedDelegationProvider() - { - return array( - array(array(), new \stdClass(), true), - array(array('henk'), new \stdClass(), false), - array(null, new \stdClass(), false), - array('henk', null, true), - array(array(1), 'henk', true), - ); - } - - /** - * Test dedicated to check if the backwards compatibility is still working. - */ - public function testOldConstructorSignature() - { - $authenticationManager = $this->getMock('Symfony\Component\Security\Core\Authentication\AuthenticationManagerInterface'); - $accessDecisionManager = $this->getMock('Symfony\Component\Security\Core\Authorization\AccessDecisionManagerInterface'); - new SecurityContext($authenticationManager, $accessDecisionManager); - } - - /** - * @dataProvider oldConstructorSignatureFailuresProvider - * @expectedException \BadMethodCallException - */ - public function testOldConstructorSignatureFailures($first, $second) - { - new SecurityContext($first, $second); - } - - public function oldConstructorSignatureFailuresProvider() - { - $tokenStorage = $this->getMock('Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface'); - $authorizationChecker = $this->getMock('Symfony\Component\Security\Core\Authorization\AuthorizationCheckerInterface'); - $authenticationManager = $this->getMock('Symfony\Component\Security\Core\Authentication\AuthenticationManagerInterface'); - $accessDecisionManager = $this->getMock('Symfony\Component\Security\Core\Authorization\AccessDecisionManagerInterface'); - - return array( - array(new \stdClass(), new \stdClass()), - array($tokenStorage, $accessDecisionManager), - array($accessDecisionManager, $tokenStorage), - array($authorizationChecker, $accessDecisionManager), - array($accessDecisionManager, $authorizationChecker), - array($tokenStorage, $accessDecisionManager), - array($authenticationManager, $authorizationChecker), - array('henk', 'hans'), - array(null, false), - array(true, null), - ); - } -} diff --git a/src/Symfony/Component/Security/Core/Tests/Util/ClassUtilsTest.php b/src/Symfony/Component/Security/Core/Tests/Util/ClassUtilsTest.php deleted file mode 100644 index b04820614a..0000000000 --- a/src/Symfony/Component/Security/Core/Tests/Util/ClassUtilsTest.php +++ /dev/null @@ -1,53 +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\Util -{ - use Symfony\Component\Security\Core\Util\ClassUtils; - - /** - * @group legacy - */ - class ClassUtilsTest extends \PHPUnit_Framework_TestCase - { - public static function dataGetClass() - { - return array( - array('stdClass', 'stdClass'), - array('Symfony\Component\Security\Core\Util\ClassUtils', 'Symfony\Component\Security\Core\Util\ClassUtils'), - array('MyProject\Proxies\__CG__\stdClass', 'stdClass'), - array('MyProject\Proxies\__CG__\OtherProject\Proxies\__CG__\stdClass', 'stdClass'), - array('MyProject\Proxies\__CG__\Symfony\Component\Security\Core\Tests\Util\ChildObject', 'Symfony\Component\Security\Core\Tests\Util\ChildObject'), - array(new TestObject(), 'Symfony\Component\Security\Core\Tests\Util\TestObject'), - array(new \Acme\DemoBundle\Proxy\__CG__\Symfony\Component\Security\Core\Tests\Util\TestObject(), 'Symfony\Component\Security\Core\Tests\Util\TestObject'), - ); - } - - /** - * @dataProvider dataGetClass - */ - public function testGetRealClass($object, $expectedClassName) - { - $this->assertEquals($expectedClassName, ClassUtils::getRealClass($object)); - } - } - - class TestObject - { - } -} - -namespace Acme\DemoBundle\Proxy\__CG__\Symfony\Component\Security\Core\Tests\Util -{ - class TestObject extends \Symfony\Component\Security\Core\Tests\Util\TestObject - { - } -} diff --git a/src/Symfony/Component/Security/Core/Tests/Validator/Constraints/LegacyUserPasswordValidatorTest.php b/src/Symfony/Component/Security/Core/Tests/Validator/Constraints/LegacyUserPasswordValidatorTest.php deleted file mode 100644 index 8053732bee..0000000000 --- a/src/Symfony/Component/Security/Core/Tests/Validator/Constraints/LegacyUserPasswordValidatorTest.php +++ /dev/null @@ -1,28 +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\Validator\Constraints; - -use Symfony\Component\Validator\Validation; - -/** - * @since 2.5.4 - * - * @author Bernhard Schussek - * @group legacy - */ -class LegacyUserPasswordValidatorTest extends UserPasswordValidatorTest -{ - protected function getApiVersion() - { - return Validation::API_VERSION_2_5_BC; - } -} diff --git a/src/Symfony/Component/Security/Core/Util/ClassUtils.php b/src/Symfony/Component/Security/Core/Util/ClassUtils.php deleted file mode 100644 index 06186ef895..0000000000 --- a/src/Symfony/Component/Security/Core/Util/ClassUtils.php +++ /dev/null @@ -1,72 +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\Util; - -use Symfony\Component\Security\Acl\Util\ClassUtils as AclClassUtils; - -@trigger_error('The '.__NAMESPACE__.'\ClassUtils class is deprecated since version 2.8, to be removed in 3.0. Use Symfony\Component\Security\Acl\Util\ClassUtils instead.', E_USER_DEPRECATED); - -/** - * Class related functionality for objects that - * might or might not be proxy objects at the moment. - * - * @deprecated ClassUtils is deprecated since version 2.8, to be removed in 3.0. Use Acl ClassUtils instead. - * - * @author Benjamin Eberlei - * @author Johannes Schmitt - */ -class ClassUtils -{ - /** - * Marker for Proxy class names. - * - * @var string - */ - const MARKER = '__CG__'; - - /** - * Length of the proxy marker. - * - * @var int - */ - const MARKER_LENGTH = 6; - - /** - * This class should not be instantiated. - */ - private function __construct() - { - } - - /** - * Gets the real class name of a class name that could be a proxy. - * - * @param string|object $object - * - * @return string - */ - public static function getRealClass($object) - { - if (class_exists('Symfony\Component\Security\Acl\Util\ClassUtils')) { - return AclClassUtils::getRealClass($object); - } - - // fallback in case security-acl is not installed - $class = is_object($object) ? get_class($object) : $object; - - if (false === $pos = strrpos($class, '\\'.self::MARKER.'\\')) { - return $class; - } - - return substr($class, $pos + self::MARKER_LENGTH + 2); - } -} diff --git a/src/Symfony/Component/Security/Http/Authentication/SimpleFormAuthenticatorInterface.php b/src/Symfony/Component/Security/Http/Authentication/SimpleFormAuthenticatorInterface.php index 112688c97c..39c3133487 100644 --- a/src/Symfony/Component/Security/Http/Authentication/SimpleFormAuthenticatorInterface.php +++ b/src/Symfony/Component/Security/Http/Authentication/SimpleFormAuthenticatorInterface.php @@ -11,11 +11,13 @@ namespace Symfony\Component\Security\Http\Authentication; -use Symfony\Component\Security\Core\Authentication\SimpleFormAuthenticatorInterface as BaseSimpleFormAuthenticatorInterface; +use Symfony\Component\HttpFoundation\Request; +use Symfony\Component\Security\Core\Authentication\SimpleAuthenticatorInterface; /** * @author Jordi Boggiano */ -interface SimpleFormAuthenticatorInterface extends BaseSimpleFormAuthenticatorInterface +interface SimpleFormAuthenticatorInterface extends SimpleAuthenticatorInterface { + public function createToken(Request $request, $username, $password, $providerKey); } diff --git a/src/Symfony/Component/Security/Http/Authentication/SimplePreAuthenticatorInterface.php b/src/Symfony/Component/Security/Http/Authentication/SimplePreAuthenticatorInterface.php index afa8049508..63abb15c9a 100644 --- a/src/Symfony/Component/Security/Http/Authentication/SimplePreAuthenticatorInterface.php +++ b/src/Symfony/Component/Security/Http/Authentication/SimplePreAuthenticatorInterface.php @@ -11,11 +11,13 @@ namespace Symfony\Component\Security\Http\Authentication; -use Symfony\Component\Security\Core\Authentication\SimplePreAuthenticatorInterface as BaseSimplePreAuthenticatorInterface; +use Symfony\Component\HttpFoundation\Request; +use Symfony\Component\Security\Core\Authentication\SimpleAuthenticatorInterface; /** * @author Jordi Boggiano */ -interface SimplePreAuthenticatorInterface extends BaseSimplePreAuthenticatorInterface +interface SimplePreAuthenticatorInterface extends SimpleAuthenticatorInterface { + public function createToken(Request $request, $providerKey); } diff --git a/src/Symfony/Component/Security/Http/Firewall/SimpleFormAuthenticationListener.php b/src/Symfony/Component/Security/Http/Firewall/SimpleFormAuthenticationListener.php index 4733b6ac26..272955306b 100644 --- a/src/Symfony/Component/Security/Http/Firewall/SimpleFormAuthenticationListener.php +++ b/src/Symfony/Component/Security/Http/Firewall/SimpleFormAuthenticationListener.php @@ -22,7 +22,7 @@ use Symfony\Component\Security\Csrf\CsrfTokenManagerInterface; use Symfony\Component\Security\Http\Authentication\AuthenticationFailureHandlerInterface; use Symfony\Component\Security\Http\Authentication\AuthenticationSuccessHandlerInterface; use Symfony\Component\Security\Core\Authentication\AuthenticationManagerInterface; -use Symfony\Component\Security\Core\Authentication\SimpleFormAuthenticatorInterface; +use Symfony\Component\Security\Http\Authentication\SimpleFormAuthenticatorInterface; use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface; use Symfony\Component\Security\Core\Security; use Symfony\Component\Security\Http\HttpUtils; diff --git a/src/Symfony/Component/Security/Http/Firewall/SimplePreAuthenticationListener.php b/src/Symfony/Component/Security/Http/Firewall/SimplePreAuthenticationListener.php index 8f1f6fdce5..2b4b59350a 100644 --- a/src/Symfony/Component/Security/Http/Firewall/SimplePreAuthenticationListener.php +++ b/src/Symfony/Component/Security/Http/Firewall/SimplePreAuthenticationListener.php @@ -15,7 +15,7 @@ use Symfony\Component\Security\Core\Authentication\AuthenticationManagerInterfac use Psr\Log\LoggerInterface; use Symfony\Component\HttpKernel\Event\GetResponseEvent; use Symfony\Component\HttpFoundation\Response; -use Symfony\Component\Security\Core\Authentication\SimplePreAuthenticatorInterface; +use Symfony\Component\Security\Http\Authentication\SimplePreAuthenticatorInterface; use Symfony\Component\Security\Core\Authentication\Token\AnonymousToken; use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface; use Symfony\Component\Security\Core\Exception\AuthenticationException; diff --git a/src/Symfony/Component/Security/Http/RememberMe/AbstractRememberMeServices.php b/src/Symfony/Component/Security/Http/RememberMe/AbstractRememberMeServices.php index 16810bd17d..765fee9f4a 100644 --- a/src/Symfony/Component/Security/Http/RememberMe/AbstractRememberMeServices.php +++ b/src/Symfony/Component/Security/Http/RememberMe/AbstractRememberMeServices.php @@ -80,16 +80,6 @@ abstract class AbstractRememberMeServices implements RememberMeServicesInterface return $this->options['remember_me_parameter']; } - /** - * @deprecated Since version 2.8, to be removed in 3.0. Use getSecret() instead. - */ - public function getKey() - { - @trigger_error(__method__.'() is deprecated since version 2.8 and will be removed in 3.0. Use getSecret() instead.', E_USER_DEPRECATED); - - return $this->getSecret(); - } - /** * @return string */ diff --git a/src/Symfony/Component/Security/Http/Tests/Firewall/SimplePreAuthenticationListenerTest.php b/src/Symfony/Component/Security/Http/Tests/Firewall/SimplePreAuthenticationListenerTest.php index 0a1286cd17..adf91b1c4d 100644 --- a/src/Symfony/Component/Security/Http/Tests/Firewall/SimplePreAuthenticationListenerTest.php +++ b/src/Symfony/Component/Security/Http/Tests/Firewall/SimplePreAuthenticationListenerTest.php @@ -42,7 +42,7 @@ class SimplePreAuthenticationListenerTest extends \PHPUnit_Framework_TestCase ->will($this->returnValue($this->token)) ; - $simpleAuthenticator = $this->getMock('Symfony\Component\Security\Core\Authentication\SimplePreAuthenticatorInterface'); + $simpleAuthenticator = $this->getMock('Symfony\Component\Security\Http\Authentication\SimplePreAuthenticatorInterface'); $simpleAuthenticator ->expects($this->once()) ->method('createToken') @@ -79,7 +79,7 @@ class SimplePreAuthenticationListenerTest extends \PHPUnit_Framework_TestCase ->with($this->equalTo(null)) ; - $simpleAuthenticator = $this->getMock('Symfony\Component\Security\Core\Authentication\SimplePreAuthenticatorInterface'); + $simpleAuthenticator = $this->getMock('Symfony\Component\Security\Http\Authentication\SimplePreAuthenticatorInterface'); $simpleAuthenticator ->expects($this->once()) ->method('createToken') diff --git a/src/Symfony/Component/Security/Tests/Core/LegacySecurityContextInterfaceTest.php b/src/Symfony/Component/Security/Tests/Core/LegacySecurityContextInterfaceTest.php deleted file mode 100644 index 5225eb52d6..0000000000 --- a/src/Symfony/Component/Security/Tests/Core/LegacySecurityContextInterfaceTest.php +++ /dev/null @@ -1,31 +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\Tests\Core; - -use Symfony\Component\Security\Core\SecurityContextInterface; -use Symfony\Component\Security\Core\Security; - -/** - * @group legacy - */ -class LegacySecurityContextInterfaceTest extends \PHPUnit_Framework_TestCase -{ - /** - * Test if the BC Layer is working as intended. - */ - public function testConstantSync() - { - $this->assertSame(Security::ACCESS_DENIED_ERROR, SecurityContextInterface::ACCESS_DENIED_ERROR); - $this->assertSame(Security::AUTHENTICATION_ERROR, SecurityContextInterface::AUTHENTICATION_ERROR); - $this->assertSame(Security::LAST_USERNAME, SecurityContextInterface::LAST_USERNAME); - } -}