diff --git a/src/Symfony/Bundle/DoctrineBundle/Security/EntityUserProvider.php b/src/Symfony/Bundle/DoctrineBundle/Security/EntityUserProvider.php
index 653a11fc66..03094c29ca 100644
--- a/src/Symfony/Bundle/DoctrineBundle/Security/EntityUserProvider.php
+++ b/src/Symfony/Bundle/DoctrineBundle/Security/EntityUserProvider.php
@@ -11,10 +11,10 @@
namespace Symfony\Bundle\DoctrineBundle\Security;
-use Symfony\Component\Security\User\AccountInterface;
-use Symfony\Component\Security\User\UserProviderInterface;
-use Symfony\Component\Security\Exception\UnsupportedAccountException;
-use Symfony\Component\Security\Exception\UsernameNotFoundException;
+use Symfony\Component\Security\Core\User\AccountInterface;
+use Symfony\Component\Security\Core\User\UserProviderInterface;
+use Symfony\Component\Security\Core\Exception\UnsupportedAccountException;
+use Symfony\Component\Security\Core\Exception\UsernameNotFoundException;
class EntityUserProvider implements UserProviderInterface
{
diff --git a/src/Symfony/Bundle/DoctrineMongoDBBundle/Security/DocumentUserProvider.php b/src/Symfony/Bundle/DoctrineMongoDBBundle/Security/DocumentUserProvider.php
index 044df32c1e..173889463e 100644
--- a/src/Symfony/Bundle/DoctrineMongoDBBundle/Security/DocumentUserProvider.php
+++ b/src/Symfony/Bundle/DoctrineMongoDBBundle/Security/DocumentUserProvider.php
@@ -11,10 +11,10 @@
namespace Symfony\Bundle\DoctrineMongoDBBundle\Security;
-use Symfony\Component\Security\User\AccountInterface;
-use Symfony\Component\Security\User\UserProviderInterface;
-use Symfony\Component\Security\Exception\UnsupportedAccountException;
-use Symfony\Component\Security\Exception\UsernameNotFoundException;
+use Symfony\Component\Security\Core\User\AccountInterface;
+use Symfony\Component\Security\Core\User\UserProviderInterface;
+use Symfony\Component\Security\Core\Exception\UnsupportedAccountException;
+use Symfony\Component\Security\Core\Exception\UsernameNotFoundException;
class DocumentUserProvider implements UserProviderInterface
{
diff --git a/src/Symfony/Bundle/FrameworkBundle/Controller/ExceptionController.php b/src/Symfony/Bundle/FrameworkBundle/Controller/ExceptionController.php
index 1c00b63363..78e3f85e48 100644
--- a/src/Symfony/Bundle/FrameworkBundle/Controller/ExceptionController.php
+++ b/src/Symfony/Bundle/FrameworkBundle/Controller/ExceptionController.php
@@ -74,7 +74,7 @@ class ExceptionController extends ContainerAware
protected function getStatusCode(FlattenException $exception)
{
switch ($exception->getClass()) {
- case 'Symfony\Component\Security\Exception\AccessDeniedException':
+ case 'Symfony\Component\Security\Core\Exception\AccessDeniedException':
return 403;
case 'Symfony\Component\HttpKernel\Exception\NotFoundHttpException':
return 404;
diff --git a/src/Symfony/Bundle/SecurityBundle/DataCollector/SecurityDataCollector.php b/src/Symfony/Bundle/SecurityBundle/DataCollector/SecurityDataCollector.php
index cbb3a92526..ba2acdc5cf 100644
--- a/src/Symfony/Bundle/SecurityBundle/DataCollector/SecurityDataCollector.php
+++ b/src/Symfony/Bundle/SecurityBundle/DataCollector/SecurityDataCollector.php
@@ -11,7 +11,7 @@
namespace Symfony\Bundle\SecurityBundle\DataCollector;
-use Symfony\Component\Security\SecurityContext;
+use Symfony\Component\Security\Core\SecurityContext;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
diff --git a/src/Symfony/Bundle/SecurityBundle/DependencyInjection/SecurityExtension.php b/src/Symfony/Bundle/SecurityBundle/DependencyInjection/SecurityExtension.php
index c9a15134a8..0c7bce8fa1 100644
--- a/src/Symfony/Bundle/SecurityBundle/DependencyInjection/SecurityExtension.php
+++ b/src/Symfony/Bundle/SecurityBundle/DependencyInjection/SecurityExtension.php
@@ -596,7 +596,7 @@ class SecurityExtension extends Extension
$userId = $name.'_'.md5(serialize(array($username, $user['password'], $user['roles'])));
$container
- ->register($userId, 'Symfony\Component\Security\User\User')
+ ->register($userId, 'Symfony\Component\Security\Core\User\User')
->setArguments(array($username, $user['password'], $user['roles']))
->setPublic(false)
;
diff --git a/src/Symfony/Bundle/SecurityBundle/Resources/config/security.xml b/src/Symfony/Bundle/SecurityBundle/Resources/config/security.xml
index 3892b5cbe7..cfaf242d4e 100644
--- a/src/Symfony/Bundle/SecurityBundle/Resources/config/security.xml
+++ b/src/Symfony/Bundle/SecurityBundle/Resources/config/security.xml
@@ -5,61 +5,61 @@
xsi:schemaLocation="http://www.symfony-project.org/schema/dic/services http://www.symfony-project.org/schema/dic/services/services-1.0.xsd">
- Symfony\Component\Security\SecurityContext
+ Symfony\Component\Security\Core\SecurityContext
false
- Symfony\Component\Security\User\AccountChecker
+ Symfony\Component\Security\Core\User\AccountChecker
null
- Symfony\Component\Security\Encoder\EncoderFactory
- Symfony\Component\Security\Encoder\MessageDigestPasswordEncoder
- Symfony\Component\Security\Encoder\PlaintextPasswordEncoder
+ Symfony\Component\Security\Core\Encoder\EncoderFactory
+ Symfony\Component\Security\Core\Encoder\MessageDigestPasswordEncoder
+ Symfony\Component\Security\Core\Encoder\PlaintextPasswordEncoder
- Symfony\Component\Security\User\InMemoryUserProvider
+ Symfony\Component\Security\Core\User\InMemoryUserProvider
- Symfony\Component\Security\Authentication\AuthenticationTrustResolver
- Symfony\Component\Security\Authentication\Token\AnonymousToken
- Symfony\Component\Security\Authentication\Token\RememberMeToken
+ Symfony\Component\Security\Core\Authentication\AuthenticationTrustResolver
+ Symfony\Component\Security\Core\Authentication\Token\AnonymousToken
+ Symfony\Component\Security\Core\Authentication\Token\RememberMeToken
- Symfony\Component\Security\Authentication\Provider\DaoAuthenticationProvider
- Symfony\Component\Security\Authentication\Provider\PreAuthenticatedAuthenticationProvider
- Symfony\Component\Security\Authentication\Provider\RememberMeAuthenticationProvider
+ Symfony\Component\Security\Core\Authentication\Provider\DaoAuthenticationProvider
+ Symfony\Component\Security\Core\Authentication\Provider\PreAuthenticatedAuthenticationProvider
+ Symfony\Component\Security\Core\Authentication\Provider\RememberMeAuthenticationProvider
- Symfony\Component\Security\Authentication\AuthenticationProviderManager
+ Symfony\Component\Security\Core\Authentication\AuthenticationProviderManager
- Symfony\Bundle\SecurityBundle\Security\EntryPoint\RetryAuthenticationEntryPoint
+ Symfony\Component\Security\Http\EntryPoint\RetryAuthenticationEntryPoint
- Symfony\Bundle\SecurityBundle\Security\Session\SessionAuthenticationStrategy
+ Symfony\Component\Security\Http\Session\SessionAuthenticationStrategy
migrate
- Symfony\Bundle\SecurityBundle\Security\EntryPoint\FormAuthenticationEntryPoint
- Symfony\Bundle\SecurityBundle\Security\Firewall\UsernamePasswordFormAuthenticationListener
+ Symfony\Component\Security\Http\EntryPoint\FormAuthenticationEntryPoint
+ Symfony\Component\Security\Http\Firewall\UsernamePasswordFormAuthenticationListener
- Symfony\Bundle\SecurityBundle\Security\EntryPoint\BasicAuthenticationEntryPoint
+ Symfony\Component\Security\Http\EntryPoint\BasicAuthenticationEntryPoint
Symfony2
- Symfony\Bundle\SecurityBundle\Security\EntryPoint\DigestAuthenticationEntryPoint
+ Symfony\Component\Security\Http\EntryPoint\DigestAuthenticationEntryPoint
Symfony2
SomethingUnique
- Symfony\Bundle\SecurityBundle\Security\Firewall\X509AuthenticationListener
+ Symfony\Component\Security\Http\Firewall\X509AuthenticationListener
SSL_CLIENT_S_DN_Email
SSL_CLIENT_S_DN
- Symfony\Bundle\SecurityBundle\Security\Firewall\BasicAuthenticationListener
- Symfony\Bundle\SecurityBundle\Security\Firewall\DigestAuthenticationListener
- Symfony\Bundle\SecurityBundle\Security\Firewall\AnonymousAuthenticationListener
+ Symfony\Component\Security\Http\Firewall\BasicAuthenticationListener
+ Symfony\Component\Security\Http\Firewall\DigestAuthenticationListener
+ Symfony\Component\Security\Http\Firewall\AnonymousAuthenticationListener
- Symfony\Component\Security\Authentication\Provider\AnonymousAuthenticationProvider
+ Symfony\Component\Security\Core\Authentication\Provider\AnonymousAuthenticationProvider
SomeRandomValue
- Symfony\Bundle\SecurityBundle\Security\Firewall\RememberMeListener
- Symfony\Component\Security\Authentication\RememberMe\InMemoryTokenProvider
+ Symfony\Component\Security\Http\Firewall\RememberMeListener
+ Symfony\Component\Security\Core\Authentication\RememberMe\InMemoryTokenProvider
- Symfony\Bundle\SecurityBundle\Security\RememberMe\PersistentTokenBasedRememberMeServices
- Symfony\Bundle\SecurityBundle\Security\RememberMe\TokenBasedRememberMeServices
+ Symfony\Component\Security\Http\RememberMe\PersistentTokenBasedRememberMeServices
+ Symfony\Component\Security\Http\RememberMe\TokenBasedRememberMeServices
SYMFONY_REMEMBERME
31536000
/
@@ -69,39 +69,39 @@
false
_remember_me
- Symfony\Bundle\SecurityBundle\Security\Firewall\ChannelListener
+ Symfony\Component\Security\Http\Firewall\ChannelListener
- Symfony\Bundle\SecurityBundle\Security\Firewall\LogoutListener
+ Symfony\Component\Security\Http\Firewall\LogoutListener
/logout
/
- Symfony\Bundle\SecurityBundle\Security\Logout\SessionLogoutHandler
- Symfony\Bundle\SecurityBundle\Security\Logout\CookieClearingLogoutHandler
+ Symfony\Component\Security\Http\Logout\SessionLogoutHandler
+ Symfony\Component\Security\Http\Logout\CookieClearingLogoutHandler
- Symfony\Bundle\SecurityBundle\Security\Firewall\SwitchUserListener
+ Symfony\Component\Security\Http\Firewall\SwitchUserListener
ROLE_ALLOWED_TO_SWITCH
_switch_user
- Symfony\Component\Security\Authorization\AccessDecisionManager
+ Symfony\Component\Security\Core\Authorization\AccessDecisionManager
affirmative
false
true
/access_denied
- Symfony\Component\Security\Authorization\Voter\RoleVoter
- Symfony\Component\Security\Authorization\Voter\AuthenticatedVoter
- Symfony\Component\Security\Authorization\Voter\RoleHierarchyVoter
+ Symfony\Component\Security\Core\Authorization\Voter\RoleVoter
+ Symfony\Component\Security\Core\Authorization\Voter\AuthenticatedVoter
+ Symfony\Component\Security\Core\Authorization\Voter\RoleHierarchyVoter
- Symfony\Bundle\SecurityBundle\Security\Firewall\AccessListener
- Symfony\Bundle\SecurityBundle\Security\AccessMap
- Symfony\Bundle\SecurityBundle\Security\Firewall\ExceptionListener
- Symfony\Bundle\SecurityBundle\Security\Firewall\ContextListener
- Symfony\Bundle\SecurityBundle\Security\Firewall
+ Symfony\Component\Security\Http\Firewall\AccessListener
+ Symfony\Component\Security\Http\AccessMap
+ Symfony\Component\Security\Http\Firewall\ExceptionListener
+ Symfony\Component\Security\Http\Firewall\ContextListener
+ Symfony\Component\Security\Http\Firewall
Symfony\Bundle\SecurityBundle\Security\FirewallMap
Symfony\Bundle\SecurityBundle\Security\FirewallContext
Symfony\Component\HttpFoundation\RequestMatcher
- Symfony\Component\Security\Role\RoleHierarchy
+ Symfony\Component\Security\Core\Role\RoleHierarchy
diff --git a/src/Symfony/Bundle/SecurityBundle/Security/FirewallContext.php b/src/Symfony/Bundle/SecurityBundle/Security/FirewallContext.php
index 8f6b3a6f88..69289175b6 100644
--- a/src/Symfony/Bundle/SecurityBundle/Security/FirewallContext.php
+++ b/src/Symfony/Bundle/SecurityBundle/Security/FirewallContext.php
@@ -2,7 +2,7 @@
namespace Symfony\Bundle\SecurityBundle\Security;
-use Symfony\Bundle\SecurityBundle\Security\Firewall\ExceptionListener;
+use Symfony\Component\Security\Http\Firewall\ExceptionListener;
/**
* This is a wrapper around the actual firewall configuration which allows us
diff --git a/src/Symfony/Bundle/SecurityBundle/Security/FirewallMap.php b/src/Symfony/Bundle/SecurityBundle/Security/FirewallMap.php
index 00c4d60a8e..ab71f1e414 100644
--- a/src/Symfony/Bundle/SecurityBundle/Security/FirewallMap.php
+++ b/src/Symfony/Bundle/SecurityBundle/Security/FirewallMap.php
@@ -2,7 +2,7 @@
namespace Symfony\Bundle\SecurityBundle\Security;
-use Symfony\Bundle\SecurityBundle\Security\FirewallMapInterface;
+use Symfony\Component\Security\Http\FirewallMapInterface;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\DependencyInjection\ContainerInterface;
diff --git a/src/Symfony/Bundle/SecurityBundle/Templating/Helper/SecurityHelper.php b/src/Symfony/Bundle/SecurityBundle/Templating/Helper/SecurityHelper.php
index b13b499e95..1a347cdb71 100644
--- a/src/Symfony/Bundle/SecurityBundle/Templating/Helper/SecurityHelper.php
+++ b/src/Symfony/Bundle/SecurityBundle/Templating/Helper/SecurityHelper.php
@@ -12,7 +12,7 @@
namespace Symfony\Bundle\SecurityBundle\Templating\Helper;
use Symfony\Component\Templating\Helper\Helper;
-use Symfony\Component\Security\SecurityContext;
+use Symfony\Component\Security\Core\SecurityContext;
/**
* SecurityHelper provides read-only access to the security context.
diff --git a/src/Symfony/Bundle/SecurityBundle/Twig/Extension/SecurityExtension.php b/src/Symfony/Bundle/SecurityBundle/Twig/Extension/SecurityExtension.php
index c76a6f99da..748e8629c2 100644
--- a/src/Symfony/Bundle/SecurityBundle/Twig/Extension/SecurityExtension.php
+++ b/src/Symfony/Bundle/SecurityBundle/Twig/Extension/SecurityExtension.php
@@ -11,7 +11,7 @@
namespace Symfony\Bundle\SecurityBundle\Twig\Extension;
-use Symfony\Component\Security\SecurityContext;
+use Symfony\Component\Security\Core\SecurityContext;
/**
* SecurityExtension exposes security context features.
diff --git a/src/Symfony/Component/Security/Acl/Domain/RoleSecurityIdentity.php b/src/Symfony/Component/Security/Acl/Domain/RoleSecurityIdentity.php
index 0a55fda325..26a1309aaa 100644
--- a/src/Symfony/Component/Security/Acl/Domain/RoleSecurityIdentity.php
+++ b/src/Symfony/Component/Security/Acl/Domain/RoleSecurityIdentity.php
@@ -12,7 +12,7 @@
namespace Symfony\Component\Security\Acl\Domain;
use Symfony\Component\Security\Acl\Model\SecurityIdentityInterface;
-use Symfony\Component\Security\Role\Role;
+use Symfony\Component\Security\Core\Role\Role;
/**
* A SecurityIdentity implementation for roles
diff --git a/src/Symfony/Component/Security/Acl/Domain/SecurityIdentityRetrievalStrategy.php b/src/Symfony/Component/Security/Acl/Domain/SecurityIdentityRetrievalStrategy.php
index d347b972d4..ae21733ca0 100644
--- a/src/Symfony/Component/Security/Acl/Domain/SecurityIdentityRetrievalStrategy.php
+++ b/src/Symfony/Component/Security/Acl/Domain/SecurityIdentityRetrievalStrategy.php
@@ -11,14 +11,14 @@
namespace Symfony\Component\Security\Acl\Domain;
-use Symfony\Component\Security\Authentication\Token\AnonymousToken;
+use Symfony\Component\Security\Core\Authentication\Token\AnonymousToken;
-use Symfony\Component\Security\User\AccountInterface;
-use Symfony\Component\Security\Authentication\Token\TokenInterface;
+use Symfony\Component\Security\Core\User\AccountInterface;
+use Symfony\Component\Security\Core\Authentication\Token\TokenInterface;
use Symfony\Component\Security\Acl\Model\SecurityIdentityRetrievalStrategyInterface;
-use Symfony\Component\Security\Authentication\AuthenticationTrustResolver;
-use Symfony\Component\Security\Role\RoleHierarchyInterface;
-use Symfony\Component\Security\Authorization\Voter\AuthenticatedVoter;
+use Symfony\Component\Security\Core\Authentication\AuthenticationTrustResolver;
+use Symfony\Component\Security\Core\Role\RoleHierarchyInterface;
+use Symfony\Component\Security\Core\Authorization\Voter\AuthenticatedVoter;
/**
* Strategy for retrieving security identities
diff --git a/src/Symfony/Component/Security/Acl/Domain/UserSecurityIdentity.php b/src/Symfony/Component/Security/Acl/Domain/UserSecurityIdentity.php
index 3c30a969ec..ed94f64494 100644
--- a/src/Symfony/Component/Security/Acl/Domain/UserSecurityIdentity.php
+++ b/src/Symfony/Component/Security/Acl/Domain/UserSecurityIdentity.php
@@ -11,8 +11,8 @@
namespace Symfony\Component\Security\Acl\Domain;
-use Symfony\Component\Security\Authentication\Token\TokenInterface;
-use Symfony\Component\Security\User\AccountInterface;
+use Symfony\Component\Security\Core\Authentication\Token\TokenInterface;
+use Symfony\Component\Security\Core\User\AccountInterface;
use Symfony\Component\Security\Acl\Model\SecurityIdentityInterface;
/**
diff --git a/src/Symfony/Component/Security/Acl/Model/SecurityIdentityRetrievalStrategyInterface.php b/src/Symfony/Component/Security/Acl/Model/SecurityIdentityRetrievalStrategyInterface.php
index 676121670f..d107615267 100644
--- a/src/Symfony/Component/Security/Acl/Model/SecurityIdentityRetrievalStrategyInterface.php
+++ b/src/Symfony/Component/Security/Acl/Model/SecurityIdentityRetrievalStrategyInterface.php
@@ -11,7 +11,7 @@
namespace Symfony\Component\Security\Acl\Model;
-use Symfony\Component\Security\Authentication\Token\TokenInterface;
+use Symfony\Component\Security\Core\Authentication\Token\TokenInterface;
/**
* Interface for retrieving security identities from tokens
diff --git a/src/Symfony/Component/Security/Acl/Voter/AclVoter.php b/src/Symfony/Component/Security/Acl/Voter/AclVoter.php
index 7230e35cf3..ee9a758b0d 100644
--- a/src/Symfony/Component/Security/Acl/Voter/AclVoter.php
+++ b/src/Symfony/Component/Security/Acl/Voter/AclVoter.php
@@ -21,9 +21,9 @@ use Symfony\Component\Security\Acl\Model\AclProviderInterface;
use Symfony\Component\Security\Acl\Permission\PermissionMapInterface;
use Symfony\Component\Security\Acl\Model\SecurityIdentityRetrievalStrategyInterface;
use Symfony\Component\Security\Acl\Model\ObjectIdentityRetrievalStrategyInterface;
-use Symfony\Component\Security\Authentication\Token\TokenInterface;
-use Symfony\Component\Security\Authorization\Voter\VoterInterface;
-use Symfony\Component\Security\Role\RoleHierarchyInterface;
+use Symfony\Component\Security\Core\Authentication\Token\TokenInterface;
+use Symfony\Component\Security\Core\Authorization\Voter\VoterInterface;
+use Symfony\Component\Security\Core\Role\RoleHierarchyInterface;
/**
* This voter can be used as a base class for implementing your own permissions.
diff --git a/src/Symfony/Component/Security/Authentication/AuthenticationManagerInterface.php b/src/Symfony/Component/Security/Core/Authentication/AuthenticationManagerInterface.php
similarity index 81%
rename from src/Symfony/Component/Security/Authentication/AuthenticationManagerInterface.php
rename to src/Symfony/Component/Security/Core/Authentication/AuthenticationManagerInterface.php
index 10625c7707..280377af98 100644
--- a/src/Symfony/Component/Security/Authentication/AuthenticationManagerInterface.php
+++ b/src/Symfony/Component/Security/Core/Authentication/AuthenticationManagerInterface.php
@@ -9,10 +9,10 @@
* file that was distributed with this source code.
*/
-namespace Symfony\Component\Security\Authentication;
+namespace Symfony\Component\Security\Core\Authentication;
-use Symfony\Component\Security\Authentication\Token\TokenInterface;
-use Symfony\Component\Security\Exception\AuthenticationException;
+use Symfony\Component\Security\Core\Authentication\Token\TokenInterface;
+use Symfony\Component\Security\Core\Exception\AuthenticationException;
/**
* AuthenticationManagerInterface is the interface for authentication managers,
diff --git a/src/Symfony/Component/Security/Authentication/AuthenticationProviderManager.php b/src/Symfony/Component/Security/Core/Authentication/AuthenticationProviderManager.php
similarity index 87%
rename from src/Symfony/Component/Security/Authentication/AuthenticationProviderManager.php
rename to src/Symfony/Component/Security/Core/Authentication/AuthenticationProviderManager.php
index 35ce9960ec..187a81b6a0 100644
--- a/src/Symfony/Component/Security/Authentication/AuthenticationProviderManager.php
+++ b/src/Symfony/Component/Security/Core/Authentication/AuthenticationProviderManager.php
@@ -9,13 +9,13 @@
* file that was distributed with this source code.
*/
-namespace Symfony\Component\Security\Authentication;
+namespace Symfony\Component\Security\Core\Authentication;
-use Symfony\Component\Security\Exception\AccountStatusException;
-use Symfony\Component\Security\Exception\AuthenticationException;
-use Symfony\Component\Security\Exception\ProviderNotFoundException;
-use Symfony\Component\Security\Authentication\Provider\AuthenticationProviderInterface;
-use Symfony\Component\Security\Authentication\Token\TokenInterface;
+use Symfony\Component\Security\Core\Exception\AccountStatusException;
+use Symfony\Component\Security\Core\Exception\AuthenticationException;
+use Symfony\Component\Security\Core\Exception\ProviderNotFoundException;
+use Symfony\Component\Security\Core\Authentication\Provider\AuthenticationProviderInterface;
+use Symfony\Component\Security\Core\Authentication\Token\TokenInterface;
/**
* AuthenticationProviderManager uses a list of AuthenticationProviderInterface
diff --git a/src/Symfony/Component/Security/Authentication/AuthenticationTrustResolver.php b/src/Symfony/Component/Security/Core/Authentication/AuthenticationTrustResolver.php
similarity index 92%
rename from src/Symfony/Component/Security/Authentication/AuthenticationTrustResolver.php
rename to src/Symfony/Component/Security/Core/Authentication/AuthenticationTrustResolver.php
index 94e01eb7b8..95b8cb4334 100644
--- a/src/Symfony/Component/Security/Authentication/AuthenticationTrustResolver.php
+++ b/src/Symfony/Component/Security/Core/Authentication/AuthenticationTrustResolver.php
@@ -9,9 +9,9 @@
* file that was distributed with this source code.
*/
-namespace Symfony\Component\Security\Authentication;
+namespace Symfony\Component\Security\Core\Authentication;
-use Symfony\Component\Security\Authentication\Token\TokenInterface;
+use Symfony\Component\Security\Core\Authentication\Token\TokenInterface;
/**
* The default implementation of the authentication trust resolver.
diff --git a/src/Symfony/Component/Security/Authentication/AuthenticationTrustResolverInterface.php b/src/Symfony/Component/Security/Core/Authentication/AuthenticationTrustResolverInterface.php
similarity index 90%
rename from src/Symfony/Component/Security/Authentication/AuthenticationTrustResolverInterface.php
rename to src/Symfony/Component/Security/Core/Authentication/AuthenticationTrustResolverInterface.php
index 47d47892b0..1f29465f6d 100644
--- a/src/Symfony/Component/Security/Authentication/AuthenticationTrustResolverInterface.php
+++ b/src/Symfony/Component/Security/Core/Authentication/AuthenticationTrustResolverInterface.php
@@ -9,9 +9,9 @@
* file that was distributed with this source code.
*/
-namespace Symfony\Component\Security\Authentication;
+namespace Symfony\Component\Security\Core\Authentication;
-use Symfony\Component\Security\Authentication\Token\TokenInterface;
+use Symfony\Component\Security\Core\Authentication\Token\TokenInterface;
/**
* Interface for resolving the authentication status of a given token.
diff --git a/src/Symfony/Component/Security/Authentication/EntryPoint/AuthenticationEntryPointInterface.php b/src/Symfony/Component/Security/Core/Authentication/EntryPoint/AuthenticationEntryPointInterface.php
similarity index 86%
rename from src/Symfony/Component/Security/Authentication/EntryPoint/AuthenticationEntryPointInterface.php
rename to src/Symfony/Component/Security/Core/Authentication/EntryPoint/AuthenticationEntryPointInterface.php
index 004837f756..7fd64bfedc 100644
--- a/src/Symfony/Component/Security/Authentication/EntryPoint/AuthenticationEntryPointInterface.php
+++ b/src/Symfony/Component/Security/Core/Authentication/EntryPoint/AuthenticationEntryPointInterface.php
@@ -9,9 +9,9 @@
* file that was distributed with this source code.
*/
-namespace Symfony\Component\Security\Authentication\EntryPoint;
+namespace Symfony\Component\Security\Core\Authentication\EntryPoint;
-use Symfony\Component\Security\Exception\AuthenticationException;
+use Symfony\Component\Security\Core\Exception\AuthenticationException;
use Symfony\Component\HttpFoundation\Request;
/**
diff --git a/src/Symfony/Component/Security/Authentication/Provider/AnonymousAuthenticationProvider.php b/src/Symfony/Component/Security/Core/Authentication/Provider/AnonymousAuthenticationProvider.php
similarity index 81%
rename from src/Symfony/Component/Security/Authentication/Provider/AnonymousAuthenticationProvider.php
rename to src/Symfony/Component/Security/Core/Authentication/Provider/AnonymousAuthenticationProvider.php
index 92f668dfca..821e17ea60 100644
--- a/src/Symfony/Component/Security/Authentication/Provider/AnonymousAuthenticationProvider.php
+++ b/src/Symfony/Component/Security/Core/Authentication/Provider/AnonymousAuthenticationProvider.php
@@ -9,11 +9,11 @@
* file that was distributed with this source code.
*/
-namespace Symfony\Component\Security\Authentication\Provider;
+namespace Symfony\Component\Security\Core\Authentication\Provider;
-use Symfony\Component\Security\Authentication\Token\TokenInterface;
-use Symfony\Component\Security\Exception\BadCredentialsException;
-use Symfony\Component\Security\Authentication\Token\AnonymousToken;
+use Symfony\Component\Security\Core\Authentication\Token\TokenInterface;
+use Symfony\Component\Security\Core\Exception\BadCredentialsException;
+use Symfony\Component\Security\Core\Authentication\Token\AnonymousToken;
/**
* AnonymousAuthenticationProvider validates AnonymousToken instances.
diff --git a/src/Symfony/Component/Security/Authentication/Provider/AuthenticationProviderInterface.php b/src/Symfony/Component/Security/Core/Authentication/Provider/AuthenticationProviderInterface.php
similarity index 79%
rename from src/Symfony/Component/Security/Authentication/Provider/AuthenticationProviderInterface.php
rename to src/Symfony/Component/Security/Core/Authentication/Provider/AuthenticationProviderInterface.php
index 843f05c9f1..89d5ed584f 100644
--- a/src/Symfony/Component/Security/Authentication/Provider/AuthenticationProviderInterface.php
+++ b/src/Symfony/Component/Security/Core/Authentication/Provider/AuthenticationProviderInterface.php
@@ -9,10 +9,10 @@
* file that was distributed with this source code.
*/
-namespace Symfony\Component\Security\Authentication\Provider;
+namespace Symfony\Component\Security\Core\Authentication\Provider;
-use Symfony\Component\Security\Authentication\Token\TokenInterface;
-use Symfony\Component\Security\Authentication\AuthenticationManagerInterface;
+use Symfony\Component\Security\Core\Authentication\Token\TokenInterface;
+use Symfony\Component\Security\Core\Authentication\AuthenticationManagerInterface;
/**
* AuthenticationProviderInterface is the interface for for all authentication
diff --git a/src/Symfony/Component/Security/Authentication/Provider/DaoAuthenticationProvider.php b/src/Symfony/Component/Security/Core/Authentication/Provider/DaoAuthenticationProvider.php
similarity index 81%
rename from src/Symfony/Component/Security/Authentication/Provider/DaoAuthenticationProvider.php
rename to src/Symfony/Component/Security/Core/Authentication/Provider/DaoAuthenticationProvider.php
index 69ef9a32ad..398f5861e7 100644
--- a/src/Symfony/Component/Security/Authentication/Provider/DaoAuthenticationProvider.php
+++ b/src/Symfony/Component/Security/Core/Authentication/Provider/DaoAuthenticationProvider.php
@@ -9,17 +9,17 @@
* file that was distributed with this source code.
*/
-namespace Symfony\Component\Security\Authentication\Provider;
+namespace Symfony\Component\Security\Core\Authentication\Provider;
-use Symfony\Component\Security\Authentication\Token\TokenInterface;
-use Symfony\Component\Security\Encoder\EncoderFactoryInterface;
-use Symfony\Component\Security\User\UserProviderInterface;
-use Symfony\Component\Security\User\AccountCheckerInterface;
-use Symfony\Component\Security\User\AccountInterface;
-use Symfony\Component\Security\Exception\UsernameNotFoundException;
-use Symfony\Component\Security\Exception\AuthenticationServiceException;
-use Symfony\Component\Security\Exception\BadCredentialsException;
-use Symfony\Component\Security\Authentication\Token\UsernamePasswordToken;
+use Symfony\Component\Security\Core\Authentication\Token\TokenInterface;
+use Symfony\Component\Security\Core\Encoder\EncoderFactoryInterface;
+use Symfony\Component\Security\Core\User\UserProviderInterface;
+use Symfony\Component\Security\Core\User\AccountCheckerInterface;
+use Symfony\Component\Security\Core\User\AccountInterface;
+use Symfony\Component\Security\Core\Exception\UsernameNotFoundException;
+use Symfony\Component\Security\Core\Exception\AuthenticationServiceException;
+use Symfony\Component\Security\Core\Exception\BadCredentialsException;
+use Symfony\Component\Security\Core\Authentication\Token\UsernamePasswordToken;
/**
* DaoAuthenticationProvider uses a UserProviderInterface to retrieve the user
diff --git a/src/Symfony/Component/Security/Authentication/Provider/PreAuthenticatedAuthenticationProvider.php b/src/Symfony/Component/Security/Core/Authentication/Provider/PreAuthenticatedAuthenticationProvider.php
similarity index 82%
rename from src/Symfony/Component/Security/Authentication/Provider/PreAuthenticatedAuthenticationProvider.php
rename to src/Symfony/Component/Security/Core/Authentication/Provider/PreAuthenticatedAuthenticationProvider.php
index 850b1ec07d..7fda9d49e8 100644
--- a/src/Symfony/Component/Security/Authentication/Provider/PreAuthenticatedAuthenticationProvider.php
+++ b/src/Symfony/Component/Security/Core/Authentication/Provider/PreAuthenticatedAuthenticationProvider.php
@@ -9,14 +9,14 @@
* file that was distributed with this source code.
*/
-namespace Symfony\Component\Security\Authentication\Provider;
+namespace Symfony\Component\Security\Core\Authentication\Provider;
-use Symfony\Component\Security\User\AccountInterface;
-use Symfony\Component\Security\User\UserProviderInterface;
-use Symfony\Component\Security\User\AccountCheckerInterface;
-use Symfony\Component\Security\Exception\BadCredentialsException;
-use Symfony\Component\Security\Authentication\Token\PreAuthenticatedToken;
-use Symfony\Component\Security\Authentication\Token\TokenInterface;
+use Symfony\Component\Security\Core\User\AccountInterface;
+use Symfony\Component\Security\Core\User\UserProviderInterface;
+use Symfony\Component\Security\Core\User\AccountCheckerInterface;
+use Symfony\Component\Security\Core\Exception\BadCredentialsException;
+use Symfony\Component\Security\Core\Authentication\Token\PreAuthenticatedToken;
+use Symfony\Component\Security\Core\Authentication\Token\TokenInterface;
/**
* Processes a pre-authenticated authentication request.
diff --git a/src/Symfony/Component/Security/Authentication/Provider/RememberMeAuthenticationProvider.php b/src/Symfony/Component/Security/Core/Authentication/Provider/RememberMeAuthenticationProvider.php
similarity index 72%
rename from src/Symfony/Component/Security/Authentication/Provider/RememberMeAuthenticationProvider.php
rename to src/Symfony/Component/Security/Core/Authentication/Provider/RememberMeAuthenticationProvider.php
index d2d026879b..95ee58822c 100644
--- a/src/Symfony/Component/Security/Authentication/Provider/RememberMeAuthenticationProvider.php
+++ b/src/Symfony/Component/Security/Core/Authentication/Provider/RememberMeAuthenticationProvider.php
@@ -1,11 +1,11 @@
onFailure($event, $request, $failed);
}
- $event->setReturnValue($response);
+ $event->setProcessed();
- return true;
+ return $response;
}
/**
diff --git a/src/Symfony/Bundle/SecurityBundle/Security/Firewall/AccessListener.php b/src/Symfony/Component/Security/Http/Firewall/AccessListener.php
similarity index 84%
rename from src/Symfony/Bundle/SecurityBundle/Security/Firewall/AccessListener.php
rename to src/Symfony/Component/Security/Http/Firewall/AccessListener.php
index 19854c5ee7..4aa1c55278 100644
--- a/src/Symfony/Bundle/SecurityBundle/Security/Firewall/AccessListener.php
+++ b/src/Symfony/Component/Security/Http/Firewall/AccessListener.php
@@ -9,17 +9,17 @@
* file that was distributed with this source code.
*/
-namespace Symfony\Bundle\SecurityBundle\Security\Firewall;
+namespace Symfony\Component\Security\Http\Firewall;
-use Symfony\Component\Security\SecurityContext;
-use Symfony\Component\Security\Authorization\AccessDecisionManagerInterface;
-use Symfony\Bundle\SecurityBundle\Security\AccessMap;
-use Symfony\Component\Security\Authentication\AuthenticationManagerInterface;
+use Symfony\Component\Security\Core\SecurityContext;
+use Symfony\Component\Security\Core\Authorization\AccessDecisionManagerInterface;
+use Symfony\Component\Security\Http\AccessMap;
+use Symfony\Component\Security\Core\Authentication\AuthenticationManagerInterface;
use Symfony\Component\HttpKernel\Log\LoggerInterface;
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
use Symfony\Component\EventDispatcher\EventInterface;
-use Symfony\Component\Security\Exception\AuthenticationCredentialsNotFoundException;
-use Symfony\Component\Security\Exception\AccessDeniedException;
+use Symfony\Component\Security\Core\Exception\AuthenticationCredentialsNotFoundException;
+use Symfony\Component\Security\Core\Exception\AccessDeniedException;
/**
* AccessListener enforces access control rules.
diff --git a/src/Symfony/Bundle/SecurityBundle/Security/Firewall/AnonymousAuthenticationListener.php b/src/Symfony/Component/Security/Http/Firewall/AnonymousAuthenticationListener.php
similarity index 91%
rename from src/Symfony/Bundle/SecurityBundle/Security/Firewall/AnonymousAuthenticationListener.php
rename to src/Symfony/Component/Security/Http/Firewall/AnonymousAuthenticationListener.php
index 1132f3d809..43ef9a9b0e 100644
--- a/src/Symfony/Bundle/SecurityBundle/Security/Firewall/AnonymousAuthenticationListener.php
+++ b/src/Symfony/Component/Security/Http/Firewall/AnonymousAuthenticationListener.php
@@ -9,13 +9,13 @@
* file that was distributed with this source code.
*/
-namespace Symfony\Bundle\SecurityBundle\Security\Firewall;
+namespace Symfony\Component\Security\Http\Firewall;
-use Symfony\Component\Security\SecurityContext;
+use Symfony\Component\Security\Core\SecurityContext;
use Symfony\Component\HttpKernel\Log\LoggerInterface;
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
use Symfony\Component\EventDispatcher\EventInterface;
-use Symfony\Component\Security\Authentication\Token\AnonymousToken;
+use Symfony\Component\Security\Core\Authentication\Token\AnonymousToken;
/**
* AnonymousAuthenticationListener automatically addds a Token if none is
diff --git a/src/Symfony/Bundle/SecurityBundle/Security/Firewall/BasicAuthenticationListener.php b/src/Symfony/Component/Security/Http/Firewall/BasicAuthenticationListener.php
similarity index 88%
rename from src/Symfony/Bundle/SecurityBundle/Security/Firewall/BasicAuthenticationListener.php
rename to src/Symfony/Component/Security/Http/Firewall/BasicAuthenticationListener.php
index 8325aa06f4..5cedf49196 100644
--- a/src/Symfony/Bundle/SecurityBundle/Security/Firewall/BasicAuthenticationListener.php
+++ b/src/Symfony/Component/Security/Http/Firewall/BasicAuthenticationListener.php
@@ -9,16 +9,16 @@
* file that was distributed with this source code.
*/
-namespace Symfony\Bundle\SecurityBundle\Security\Firewall;
+namespace Symfony\Component\Security\Http\Firewall;
-use Symfony\Component\Security\SecurityContext;
-use Symfony\Component\Security\Authentication\AuthenticationManagerInterface;
-use Symfony\Component\Security\Authentication\EntryPoint\AuthenticationEntryPointInterface;
+use Symfony\Component\Security\Core\SecurityContext;
+use Symfony\Component\Security\Core\Authentication\AuthenticationManagerInterface;
+use Symfony\Component\Security\Core\Authentication\EntryPoint\AuthenticationEntryPointInterface;
use Symfony\Component\HttpKernel\Log\LoggerInterface;
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
use Symfony\Component\EventDispatcher\EventInterface;
-use Symfony\Component\Security\Authentication\Token\UsernamePasswordToken;
-use Symfony\Component\Security\Exception\AuthenticationException;
+use Symfony\Component\Security\Core\Authentication\Token\UsernamePasswordToken;
+use Symfony\Component\Security\Core\Exception\AuthenticationException;
/**
* BasicAuthenticationListener implements Basic HTTP authentication.
diff --git a/src/Symfony/Bundle/SecurityBundle/Security/Firewall/ChannelListener.php b/src/Symfony/Component/Security/Http/Firewall/ChannelListener.php
similarity index 92%
rename from src/Symfony/Bundle/SecurityBundle/Security/Firewall/ChannelListener.php
rename to src/Symfony/Component/Security/Http/Firewall/ChannelListener.php
index 86c730510a..39f8eef761 100644
--- a/src/Symfony/Bundle/SecurityBundle/Security/Firewall/ChannelListener.php
+++ b/src/Symfony/Component/Security/Http/Firewall/ChannelListener.php
@@ -9,10 +9,10 @@
* file that was distributed with this source code.
*/
-namespace Symfony\Bundle\SecurityBundle\Security\Firewall;
+namespace Symfony\Component\Security\Http\Firewall;
-use Symfony\Bundle\SecurityBundle\Security\AccessMap;
-use Symfony\Component\Security\Authentication\EntryPoint\AuthenticationEntryPointInterface;
+use Symfony\Component\Security\Http\AccessMap;
+use Symfony\Component\Security\Core\Authentication\EntryPoint\AuthenticationEntryPointInterface;
use Symfony\Component\HttpKernel\Log\LoggerInterface;
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
use Symfony\Component\EventDispatcher\EventInterface;
diff --git a/src/Symfony/Bundle/SecurityBundle/Security/Firewall/ContextListener.php b/src/Symfony/Component/Security/Http/Firewall/ContextListener.php
similarity index 91%
rename from src/Symfony/Bundle/SecurityBundle/Security/Firewall/ContextListener.php
rename to src/Symfony/Component/Security/Http/Firewall/ContextListener.php
index a03bf11d54..edc2f8cda5 100644
--- a/src/Symfony/Bundle/SecurityBundle/Security/Firewall/ContextListener.php
+++ b/src/Symfony/Component/Security/Http/Firewall/ContextListener.php
@@ -9,19 +9,19 @@
* file that was distributed with this source code.
*/
-namespace Symfony\Bundle\SecurityBundle\Security\Firewall;
+namespace Symfony\Component\Security\Http\Firewall;
use Symfony\Component\EventDispatcher\EventInterface;
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpKernel\HttpKernelInterface;
use Symfony\Component\HttpKernel\Log\LoggerInterface;
-use Symfony\Component\Security\Authentication\Token\AnonymousToken;
-use Symfony\Component\Security\Authentication\Token\TokenInterface;
-use Symfony\Component\Security\Exception\UsernameNotFoundException;
-use Symfony\Component\Security\Exception\UnsupportedAccountException;
-use Symfony\Component\Security\SecurityContext;
-use Symfony\Component\Security\User\AccountInterface;
+use Symfony\Component\Security\Core\Authentication\Token\AnonymousToken;
+use Symfony\Component\Security\Core\Authentication\Token\TokenInterface;
+use Symfony\Component\Security\Core\Exception\UsernameNotFoundException;
+use Symfony\Component\Security\Core\Exception\UnsupportedAccountException;
+use Symfony\Component\Security\Core\SecurityContext;
+use Symfony\Component\Security\Core\User\AccountInterface;
/**
* ContextListener manages the SecurityContext persistence through a session.
diff --git a/src/Symfony/Bundle/SecurityBundle/Security/Firewall/DigestAuthenticationListener.php b/src/Symfony/Component/Security/Http/Firewall/DigestAuthenticationListener.php
similarity index 92%
rename from src/Symfony/Bundle/SecurityBundle/Security/Firewall/DigestAuthenticationListener.php
rename to src/Symfony/Component/Security/Http/Firewall/DigestAuthenticationListener.php
index 8d52d7ea2e..ea6a880970 100644
--- a/src/Symfony/Bundle/SecurityBundle/Security/Firewall/DigestAuthenticationListener.php
+++ b/src/Symfony/Component/Security/Http/Firewall/DigestAuthenticationListener.php
@@ -9,21 +9,21 @@
* file that was distributed with this source code.
*/
-namespace Symfony\Bundle\SecurityBundle\Security\Firewall;
+namespace Symfony\Component\Security\Http\Firewall;
-use Symfony\Component\Security\SecurityContext;
-use Symfony\Component\Security\User\UserProviderInterface;
-use Symfony\Bundle\SecurityBundle\Security\EntryPoint\DigestAuthenticationEntryPoint;
+use Symfony\Component\Security\Core\SecurityContext;
+use Symfony\Component\Security\Core\User\UserProviderInterface;
+use Symfony\Component\Security\Http\EntryPoint\DigestAuthenticationEntryPoint;
use Symfony\Component\HttpKernel\Log\LoggerInterface;
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
use Symfony\Component\EventDispatcher\EventInterface;
-use Symfony\Component\Security\Authentication\Token\UsernamePasswordToken;
-use Symfony\Component\Security\Exception\BadCredentialsException;
-use Symfony\Component\Security\Exception\AuthenticationServiceException;
-use Symfony\Component\Security\Exception\UsernameNotFoundException;
-use Symfony\Bundle\SecurityBundle\Security\EntryPoint\NonceExpiredException;
+use Symfony\Component\Security\Core\Authentication\Token\UsernamePasswordToken;
+use Symfony\Component\Security\Core\Exception\BadCredentialsException;
+use Symfony\Component\Security\Core\Exception\AuthenticationServiceException;
+use Symfony\Component\Security\Core\Exception\UsernameNotFoundException;
+use Symfony\Component\Security\Http\EntryPoint\NonceExpiredException;
use Symfony\Component\HttpFoundation\Request;
-use Symfony\Component\Security\Exception\AuthenticationException;
+use Symfony\Component\Security\Core\Exception\AuthenticationException;
/**
* DigestAuthenticationListener implements Digest HTTP authentication.
diff --git a/src/Symfony/Bundle/SecurityBundle/Security/Firewall/ExceptionListener.php b/src/Symfony/Component/Security/Http/Firewall/ExceptionListener.php
similarity index 89%
rename from src/Symfony/Bundle/SecurityBundle/Security/Firewall/ExceptionListener.php
rename to src/Symfony/Component/Security/Http/Firewall/ExceptionListener.php
index 611731283f..6d3aa6b11d 100644
--- a/src/Symfony/Bundle/SecurityBundle/Security/Firewall/ExceptionListener.php
+++ b/src/Symfony/Component/Security/Http/Firewall/ExceptionListener.php
@@ -9,21 +9,21 @@
* file that was distributed with this source code.
*/
-namespace Symfony\Bundle\SecurityBundle\Security\Firewall;
+namespace Symfony\Component\Security\Http\Firewall;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Bundle\SecurityBundle\Security\AccessDeniedHandler;
-use Symfony\Bundle\SecurityBundle\Security\ExceptionTranslation\AccessDeniedHandlerInterface;
-use Symfony\Component\Security\SecurityContext;
-use Symfony\Component\Security\Authentication\AuthenticationTrustResolverInterface;
-use Symfony\Component\Security\Authentication\EntryPoint\AuthenticationEntryPointInterface;
+use Symfony\Component\Security\Http\ExceptionTranslation\AccessDeniedHandlerInterface;
+use Symfony\Component\Security\Core\SecurityContext;
+use Symfony\Component\Security\Core\Authentication\AuthenticationTrustResolverInterface;
+use Symfony\Component\Security\Core\Authentication\EntryPoint\AuthenticationEntryPointInterface;
use Symfony\Component\HttpKernel\Log\LoggerInterface;
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
use Symfony\Component\EventDispatcher\EventInterface;
-use Symfony\Component\Security\Exception\AuthenticationException;
-use Symfony\Component\Security\Exception\AccessDeniedException;
-use Symfony\Component\Security\Authentication\Token\AnonymousToken;
-use Symfony\Component\Security\Exception\InsufficientAuthenticationException;
+use Symfony\Component\Security\Core\Exception\AuthenticationException;
+use Symfony\Component\Security\Core\Exception\AccessDeniedException;
+use Symfony\Component\Security\Core\Authentication\Token\AnonymousToken;
+use Symfony\Component\Security\Core\Exception\InsufficientAuthenticationException;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpKernel\HttpKernelInterface;
diff --git a/src/Symfony/Bundle/SecurityBundle/Security/Firewall/ListenerInterface.php b/src/Symfony/Component/Security/Http/Firewall/ListenerInterface.php
similarity index 95%
rename from src/Symfony/Bundle/SecurityBundle/Security/Firewall/ListenerInterface.php
rename to src/Symfony/Component/Security/Http/Firewall/ListenerInterface.php
index 6494c7ce7b..afb2d9f028 100644
--- a/src/Symfony/Bundle/SecurityBundle/Security/Firewall/ListenerInterface.php
+++ b/src/Symfony/Component/Security/Http/Firewall/ListenerInterface.php
@@ -9,7 +9,7 @@
* file that was distributed with this source code.
*/
-namespace Symfony\Bundle\SecurityBundle\Security\Firewall;
+namespace Symfony\Component\Security\Http\Firewall;
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
diff --git a/src/Symfony/Bundle/SecurityBundle/Security/Firewall/LogoutListener.php b/src/Symfony/Component/Security/Http/Firewall/LogoutListener.php
similarity index 93%
rename from src/Symfony/Bundle/SecurityBundle/Security/Firewall/LogoutListener.php
rename to src/Symfony/Component/Security/Http/Firewall/LogoutListener.php
index c84d6deae9..fb4bac91fc 100644
--- a/src/Symfony/Bundle/SecurityBundle/Security/Firewall/LogoutListener.php
+++ b/src/Symfony/Component/Security/Http/Firewall/LogoutListener.php
@@ -9,10 +9,10 @@
* file that was distributed with this source code.
*/
-namespace Symfony\Bundle\SecurityBundle\Security\Firewall;
+namespace Symfony\Component\Security\Http\Firewall;
-use Symfony\Bundle\SecurityBundle\Security\Logout\LogoutHandlerInterface;
-use Symfony\Component\Security\SecurityContext;
+use Symfony\Component\Security\Http\Logout\LogoutHandlerInterface;
+use Symfony\Component\Security\Core\SecurityContext;
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
use Symfony\Component\EventDispatcher\EventInterface;
use Symfony\Component\HttpFoundation\Response;
diff --git a/src/Symfony/Bundle/SecurityBundle/Security/Firewall/PreAuthenticatedListener.php b/src/Symfony/Component/Security/Http/Firewall/PreAuthenticatedListener.php
similarity index 91%
rename from src/Symfony/Bundle/SecurityBundle/Security/Firewall/PreAuthenticatedListener.php
rename to src/Symfony/Component/Security/Http/Firewall/PreAuthenticatedListener.php
index 194be764fc..b4160ea0b9 100644
--- a/src/Symfony/Bundle/SecurityBundle/Security/Firewall/PreAuthenticatedListener.php
+++ b/src/Symfony/Component/Security/Http/Firewall/PreAuthenticatedListener.php
@@ -9,15 +9,15 @@
* file that was distributed with this source code.
*/
-namespace Symfony\Bundle\SecurityBundle\Security\Firewall;
+namespace Symfony\Component\Security\Http\Firewall;
-use Symfony\Component\Security\SecurityContext;
-use Symfony\Component\Security\Authentication\AuthenticationManagerInterface;
+use Symfony\Component\Security\Core\SecurityContext;
+use Symfony\Component\Security\Core\Authentication\AuthenticationManagerInterface;
use Symfony\Component\HttpKernel\Log\LoggerInterface;
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
use Symfony\Component\EventDispatcher\EventInterface;
-use Symfony\Component\Security\Authentication\Token\PreAuthenticatedToken;
-use Symfony\Component\Security\Exception\AuthenticationException;
+use Symfony\Component\Security\Core\Authentication\Token\PreAuthenticatedToken;
+use Symfony\Component\Security\Core\Exception\AuthenticationException;
use Symfony\Component\HttpFoundation\Request;
/**
diff --git a/src/Symfony/Bundle/SecurityBundle/Security/Firewall/RememberMeListener.php b/src/Symfony/Component/Security/Http/Firewall/RememberMeListener.php
similarity index 90%
rename from src/Symfony/Bundle/SecurityBundle/Security/Firewall/RememberMeListener.php
rename to src/Symfony/Component/Security/Http/Firewall/RememberMeListener.php
index 11c477c07f..e083492afd 100644
--- a/src/Symfony/Bundle/SecurityBundle/Security/Firewall/RememberMeListener.php
+++ b/src/Symfony/Component/Security/Http/Firewall/RememberMeListener.php
@@ -1,18 +1,18 @@
+ *
+ * This source file is subject to the MIT license that is bundled
+ * with this source code in the file LICENSE.
+ */
+
+/**
+ * FirewallMap allows configuration of different firewalls for specific parts
+ * of the website.
+ *
+ * @author Fabien Potencier
+ */
+class FirewallMap implements FirewallMapInterface
+{
+ protected $map = array();
+
+ public function add(RequestMatcherInterface $requestMatcher = null, array $listeners = array(), ExceptionListener $exceptionListener = null)
+ {
+ $this->map[] = array($requestMatcher, $listeners, $exceptionListener);
+ }
+
+ public function getListeners(Request $request)
+ {
+ foreach ($this->map as $elements) {
+ if (null === $elements[0] || $elements[0]->matches($request)) {
+ return array($elements[1], $elements[2]);
+ }
+ }
+
+ return array(array(), null);
+ }
+}
diff --git a/src/Symfony/Bundle/SecurityBundle/Security/FirewallMapInterface.php b/src/Symfony/Component/Security/Http/FirewallMapInterface.php
similarity index 93%
rename from src/Symfony/Bundle/SecurityBundle/Security/FirewallMapInterface.php
rename to src/Symfony/Component/Security/Http/FirewallMapInterface.php
index cbdf1c8024..575b96fb5f 100644
--- a/src/Symfony/Bundle/SecurityBundle/Security/FirewallMapInterface.php
+++ b/src/Symfony/Component/Security/Http/FirewallMapInterface.php
@@ -1,6 +1,6 @@
getSession()->migrate();
- break;
+ return;
case self::INVALIDATE:
$request->getSession()->invalidate();
+ return;
default:
throw new \RuntimeException(sprintf('Invalid session authentication strategy "%s"', $this->strategy));
diff --git a/src/Symfony/Bundle/SecurityBundle/Security/Session/SessionAuthenticationStrategyInterface.php b/src/Symfony/Component/Security/Http/Session/SessionAuthenticationStrategyInterface.php
similarity index 58%
rename from src/Symfony/Bundle/SecurityBundle/Security/Session/SessionAuthenticationStrategyInterface.php
rename to src/Symfony/Component/Security/Http/Session/SessionAuthenticationStrategyInterface.php
index 9efa5da52d..c2d95c3463 100644
--- a/src/Symfony/Bundle/SecurityBundle/Security/Session/SessionAuthenticationStrategyInterface.php
+++ b/src/Symfony/Component/Security/Http/Session/SessionAuthenticationStrategyInterface.php
@@ -1,8 +1,8 @@
getStrategy($roles, $authenticationStatus);
if ('anonymous' === $authenticationStatus) {
- $token = $this->getMockBuilder('Symfony\Component\Security\Authentication\Token\AnonymousToken')
+ $token = $this->getMockBuilder('Symfony\Component\Security\Core\Authentication\Token\AnonymousToken')
->disableOriginalConstructor()
->getMock();
} else {
@@ -34,7 +34,7 @@ class SecurityIdentityRetrievalStrategyTest extends \PHPUnit_Framework_TestCase
$class = 'MyCustomTokenImpl';
}
- $token = $this->getMockBuilder('Symfony\Component\Security\Authentication\Token\TokenInterface')
+ $token = $this->getMockBuilder('Symfony\Component\Security\Core\Authentication\Token\TokenInterface')
->setMockClassName($class)
->getMock();
}
@@ -109,7 +109,7 @@ class SecurityIdentityRetrievalStrategyTest extends \PHPUnit_Framework_TestCase
protected function getAccount($username, $class)
{
- $account = $this->getMock('Symfony\Component\Security\User\AccountInterface', array(), array(), $class);
+ $account = $this->getMock('Symfony\Component\Security\Core\User\AccountInterface', array(), array(), $class);
$account
->expects($this->any())
->method('getUsername')
@@ -122,7 +122,7 @@ class SecurityIdentityRetrievalStrategyTest extends \PHPUnit_Framework_TestCase
protected function getStrategy(array $roles = array(), $authenticationStatus = 'fullFledged')
{
- $roleHierarchy = $this->getMock('Symfony\Component\Security\Role\RoleHierarchyInterface');
+ $roleHierarchy = $this->getMock('Symfony\Component\Security\Core\Role\RoleHierarchyInterface');
$roleHierarchy
->expects($this->once())
->method('getReachableRoles')
@@ -130,7 +130,7 @@ class SecurityIdentityRetrievalStrategyTest extends \PHPUnit_Framework_TestCase
->will($this->returnValue($roles))
;
- $trustResolver = $this->getMock('Symfony\Component\Security\Authentication\AuthenticationTrustResolver', array(), array('', ''));
+ $trustResolver = $this->getMock('Symfony\Component\Security\Core\Authentication\AuthenticationTrustResolver', array(), array('', ''));
$trustResolver
->expects($this->at(0))
diff --git a/tests/Symfony/Tests/Component/Security/Acl/Domain/UserSecurityIdentityTest.php b/tests/Symfony/Tests/Component/Security/Acl/Domain/UserSecurityIdentityTest.php
index fcbe0c4b73..96b5bc4365 100644
--- a/tests/Symfony/Tests/Component/Security/Acl/Domain/UserSecurityIdentityTest.php
+++ b/tests/Symfony/Tests/Component/Security/Acl/Domain/UserSecurityIdentityTest.php
@@ -34,7 +34,7 @@ class UserSecurityIdentityTest extends \PHPUnit_Framework_TestCase
public function getCompareData()
{
- $account = $this->getMockBuilder('Symfony\Component\Security\User\AccountInterface')
+ $account = $this->getMockBuilder('Symfony\Component\Security\Core\User\AccountInterface')
->setMockClassName('USI_AccountImpl')
->getMock();
$account
@@ -43,7 +43,7 @@ class UserSecurityIdentityTest extends \PHPUnit_Framework_TestCase
->will($this->returnValue('foo'))
;
- $token = $this->getMock('Symfony\Component\Security\Authentication\Token\TokenInterface');
+ $token = $this->getMock('Symfony\Component\Security\Core\Authentication\Token\TokenInterface');
$token
->expects($this->any())
->method('getUser')
diff --git a/tests/Symfony/Tests/Component/Security/Acl/Voter/AclVoterTest.php b/tests/Symfony/Tests/Component/Security/Acl/Voter/AclVoterTest.php
index b3dabd024d..ef07698454 100644
--- a/tests/Symfony/Tests/Component/Security/Acl/Voter/AclVoterTest.php
+++ b/tests/Symfony/Tests/Component/Security/Acl/Voter/AclVoterTest.php
@@ -17,7 +17,7 @@ use Symfony\Component\Security\Acl\Exception\AclNotFoundException;
use Symfony\Component\Security\Acl\Domain\RoleSecurityIdentity;
use Symfony\Component\Security\Acl\Domain\UserSecurityIdentity;
use Symfony\Component\Security\Acl\Domain\ObjectIdentity;
-use Symfony\Component\Security\Authorization\Voter\VoterInterface;
+use Symfony\Component\Security\Core\Authorization\Voter\VoterInterface;
use Symfony\Component\Security\Acl\Voter\AclVoter;
class AclVoterTest extends \PHPUnit_Framework_TestCase
@@ -363,7 +363,7 @@ class AclVoterTest extends \PHPUnit_Framework_TestCase
protected function getToken()
{
- return $this->getMock('Symfony\Component\Security\Authentication\Token\TokenInterface');
+ return $this->getMock('Symfony\Component\Security\Core\Authentication\Token\TokenInterface');
}
protected function getVoter($allowIfObjectIdentityUnavailable = true)
diff --git a/tests/Symfony/Tests/Component/Security/Authentication/AuthenticationProviderManagerTest.php b/tests/Symfony/Tests/Component/Security/Core/Authentication/AuthenticationProviderManagerTest.php
similarity index 72%
rename from tests/Symfony/Tests/Component/Security/Authentication/AuthenticationProviderManagerTest.php
rename to tests/Symfony/Tests/Component/Security/Core/Authentication/AuthenticationProviderManagerTest.php
index 69765daf1e..062839e9ba 100644
--- a/tests/Symfony/Tests/Component/Security/Authentication/AuthenticationProviderManagerTest.php
+++ b/tests/Symfony/Tests/Component/Security/Core/Authentication/AuthenticationProviderManagerTest.php
@@ -9,23 +9,23 @@
* file that was distributed with this source code.
*/
-namespace Symfony\Tests\Component\Security\Authentication;
+namespace Symfony\Tests\Component\Security\Core\Authentication;
-use Symfony\Component\Security\Authentication\AuthenticationProviderManager;
-use Symfony\Component\Security\Exception\ProviderNotFoundException;
-use Symfony\Component\Security\Exception\AuthenticationException;
-use Symfony\Component\Security\Exception\AccountStatusException;
-use Symfony\Component\Security\Authentication\Token\UsernamePasswordToken;
+use Symfony\Component\Security\Core\Authentication\AuthenticationProviderManager;
+use Symfony\Component\Security\Core\Exception\ProviderNotFoundException;
+use Symfony\Component\Security\Core\Exception\AuthenticationException;
+use Symfony\Component\Security\Core\Exception\AccountStatusException;
+use Symfony\Component\Security\Core\Authentication\Token\UsernamePasswordToken;
class AuthenticationProviderManagerTest extends \PHPUnit_Framework_TestCase
{
public function testProviderAccessors()
{
$manager = new AuthenticationProviderManager();
- $manager->add($provider = $this->getMock('Symfony\Component\Security\Authentication\Provider\AuthenticationProviderInterface'));
+ $manager->add($provider = $this->getMock('Symfony\Component\Security\Core\Authentication\Provider\AuthenticationProviderInterface'));
$this->assertSame(array($provider), $manager->all());
- $manager->setProviders($providers = array($this->getMock('Symfony\Component\Security\Authentication\Provider\AuthenticationProviderInterface')));
+ $manager->setProviders($providers = array($this->getMock('Symfony\Component\Security\Core\Authentication\Provider\AuthenticationProviderInterface')));
$this->assertSame($providers, $manager->all());
}
@@ -35,7 +35,7 @@ class AuthenticationProviderManagerTest extends \PHPUnit_Framework_TestCase
public function testAuthenticateWithoutProviders()
{
$manager = new AuthenticationProviderManager();
- $manager->authenticate($this->getMock('Symfony\Component\Security\Authentication\Token\TokenInterface'));
+ $manager->authenticate($this->getMock('Symfony\Component\Security\Core\Authentication\Token\TokenInterface'));
}
public function testAuthenticateWhenNoProviderSupportsToken()
@@ -45,7 +45,7 @@ class AuthenticationProviderManagerTest extends \PHPUnit_Framework_TestCase
));
try {
- $manager->authenticate($token = $this->getMock('Symfony\Component\Security\Authentication\Token\TokenInterface'));
+ $manager->authenticate($token = $this->getMock('Symfony\Component\Security\Core\Authentication\Token\TokenInterface'));
$this->fail();
} catch (ProviderNotFoundException $e) {
$this->assertSame($token, $e->getExtraInformation());
@@ -55,11 +55,11 @@ class AuthenticationProviderManagerTest extends \PHPUnit_Framework_TestCase
public function testAuthenticateWhenProviderReturnsAccountStatusException()
{
$manager = new AuthenticationProviderManager(array(
- $this->getAuthenticationProvider(true, null, 'Symfony\Component\Security\Exception\AccountStatusException'),
+ $this->getAuthenticationProvider(true, null, 'Symfony\Component\Security\Core\Exception\AccountStatusException'),
));
try {
- $manager->authenticate($token = $this->getMock('Symfony\Component\Security\Authentication\Token\TokenInterface'));
+ $manager->authenticate($token = $this->getMock('Symfony\Component\Security\Core\Authentication\Token\TokenInterface'));
$this->fail();
} catch (AccountStatusException $e) {
$this->assertSame($token, $e->getExtraInformation());
@@ -69,11 +69,11 @@ class AuthenticationProviderManagerTest extends \PHPUnit_Framework_TestCase
public function testAuthenticateWhenProviderReturnsAuthenticationException()
{
$manager = new AuthenticationProviderManager(array(
- $this->getAuthenticationProvider(true, null, 'Symfony\Component\Security\Exception\AuthenticationException'),
+ $this->getAuthenticationProvider(true, null, 'Symfony\Component\Security\Core\Exception\AuthenticationException'),
));
try {
- $manager->authenticate($token = $this->getMock('Symfony\Component\Security\Authentication\Token\TokenInterface'));
+ $manager->authenticate($token = $this->getMock('Symfony\Component\Security\Core\Authentication\Token\TokenInterface'));
$this->fail();
} catch (AuthenticationException $e) {
$this->assertSame($token, $e->getExtraInformation());
@@ -83,22 +83,22 @@ class AuthenticationProviderManagerTest extends \PHPUnit_Framework_TestCase
public function testAuthenticateWhenOneReturnsAuthenticationExceptionButNotAll()
{
$manager = new AuthenticationProviderManager(array(
- $this->getAuthenticationProvider(true, null, 'Symfony\Component\Security\Exception\AuthenticationException'),
- $this->getAuthenticationProvider(true, $expected = $this->getMock('Symfony\Component\Security\Authentication\Token\TokenInterface')),
+ $this->getAuthenticationProvider(true, null, 'Symfony\Component\Security\Core\Exception\AuthenticationException'),
+ $this->getAuthenticationProvider(true, $expected = $this->getMock('Symfony\Component\Security\Core\Authentication\Token\TokenInterface')),
));
- $token = $manager->authenticate($this->getMock('Symfony\Component\Security\Authentication\Token\TokenInterface'));
+ $token = $manager->authenticate($this->getMock('Symfony\Component\Security\Core\Authentication\Token\TokenInterface'));
$this->assertSame($expected, $token);
}
public function testAuthenticateReturnsTokenForTheLastMatch()
{
$manager = new AuthenticationProviderManager(array(
- $this->getAuthenticationProvider(true, $this->getMock('Symfony\Component\Security\Authentication\Token\TokenInterface')),
- $this->getAuthenticationProvider(true, $expected = $this->getMock('Symfony\Component\Security\Authentication\Token\TokenInterface')),
+ $this->getAuthenticationProvider(true, $this->getMock('Symfony\Component\Security\Core\Authentication\Token\TokenInterface')),
+ $this->getAuthenticationProvider(true, $expected = $this->getMock('Symfony\Component\Security\Core\Authentication\Token\TokenInterface')),
));
- $token = $manager->authenticate($this->getMock('Symfony\Component\Security\Authentication\Token\TokenInterface'));
+ $token = $manager->authenticate($this->getMock('Symfony\Component\Security\Core\Authentication\Token\TokenInterface'));
$this->assertSame($expected, $token);
}
@@ -108,20 +108,20 @@ class AuthenticationProviderManagerTest extends \PHPUnit_Framework_TestCase
$this->getAuthenticationProvider(true, $token = new UsernamePasswordToken('foo', 'bar', 'key')),
));
- $token = $manager->authenticate($this->getMock('Symfony\Component\Security\Authentication\Token\TokenInterface'));
+ $token = $manager->authenticate($this->getMock('Symfony\Component\Security\Core\Authentication\Token\TokenInterface'));
$this->assertEquals('', $token->getCredentials());
$manager = new AuthenticationProviderManager(array(
$this->getAuthenticationProvider(true, $token = new UsernamePasswordToken('foo', 'bar', 'key')),
), false);
- $token = $manager->authenticate($this->getMock('Symfony\Component\Security\Authentication\Token\TokenInterface'));
+ $token = $manager->authenticate($this->getMock('Symfony\Component\Security\Core\Authentication\Token\TokenInterface'));
$this->assertEquals('bar', $token->getCredentials());
}
protected function getAuthenticationProvider($supports, $token = null, $exception = null)
{
- $provider = $this->getMock('Symfony\Component\Security\Authentication\Provider\AuthenticationProviderInterface');
+ $provider = $this->getMock('Symfony\Component\Security\Core\Authentication\Provider\AuthenticationProviderInterface');
$provider->expects($this->once())
->method('supports')
->will($this->returnValue($supports))
diff --git a/tests/Symfony/Tests/Component/Security/Authentication/AuthenticationTrustResolverTest.php b/tests/Symfony/Tests/Component/Security/Core/Authentication/AuthenticationTrustResolverTest.php
similarity index 67%
rename from tests/Symfony/Tests/Component/Security/Authentication/AuthenticationTrustResolverTest.php
rename to tests/Symfony/Tests/Component/Security/Core/Authentication/AuthenticationTrustResolverTest.php
index 78726d193b..342334d81e 100644
--- a/tests/Symfony/Tests/Component/Security/Authentication/AuthenticationTrustResolverTest.php
+++ b/tests/Symfony/Tests/Component/Security/Core/Authentication/AuthenticationTrustResolverTest.php
@@ -9,11 +9,11 @@
* file that was distributed with this source code.
*/
-namespace Symfony\Tests\Component\Security\Authentication;
+namespace Symfony\Tests\Component\Security\Core\Authentication;
-use Symfony\Component\Security\Authentication\Token\AnonymousToken;
-use Symfony\Component\Security\Authentication\Token\RememberMeToken;
-use Symfony\Component\Security\Authentication\AuthenticationTrustResolver;
+use Symfony\Component\Security\Core\Authentication\Token\AnonymousToken;
+use Symfony\Component\Security\Core\Authentication\Token\RememberMeToken;
+use Symfony\Component\Security\Core\Authentication\AuthenticationTrustResolver;
class AuthenticationTrustResolverTest extends \PHPUnit_Framework_TestCase
{
@@ -49,24 +49,24 @@ class AuthenticationTrustResolverTest extends \PHPUnit_Framework_TestCase
protected function getToken()
{
- return $this->getMock('Symfony\Component\Security\Authentication\Token\TokenInterface');
+ return $this->getMock('Symfony\Component\Security\Core\Authentication\Token\TokenInterface');
}
protected function getAnonymousToken()
{
- return $this->getMock('Symfony\Component\Security\Authentication\Token\AnonymousToken', null, array('', ''));
+ return $this->getMock('Symfony\Component\Security\Core\Authentication\Token\AnonymousToken', null, array('', ''));
}
protected function getRememberMeToken()
{
- return $this->getMock('Symfony\Component\Security\Authentication\Token\RememberMeToken', array('setPersistent'), array(), '', false);
+ return $this->getMock('Symfony\Component\Security\Core\Authentication\Token\RememberMeToken', array('setPersistent'), array(), '', false);
}
protected function getResolver()
{
return new AuthenticationTrustResolver(
- 'Symfony\\Component\\Security\\Authentication\\Token\\AnonymousToken',
- 'Symfony\\Component\\Security\\Authentication\\Token\\RememberMeToken'
+ 'Symfony\\Component\\Security\\Core\\Authentication\\Token\\AnonymousToken',
+ 'Symfony\\Component\\Security\\Core\\Authentication\\Token\\RememberMeToken'
);
}
}
\ No newline at end of file
diff --git a/tests/Symfony/Tests/Component/Security/Authentication/Provider/AnonymousAuthenticationProviderTest.php b/tests/Symfony/Tests/Component/Security/Core/Authentication/Provider/AnonymousAuthenticationProviderTest.php
similarity index 73%
rename from tests/Symfony/Tests/Component/Security/Authentication/Provider/AnonymousAuthenticationProviderTest.php
rename to tests/Symfony/Tests/Component/Security/Core/Authentication/Provider/AnonymousAuthenticationProviderTest.php
index 94f4e7bc81..47e0cdcff0 100644
--- a/tests/Symfony/Tests/Component/Security/Authentication/Provider/AnonymousAuthenticationProviderTest.php
+++ b/tests/Symfony/Tests/Component/Security/Core/Authentication/Provider/AnonymousAuthenticationProviderTest.php
@@ -9,9 +9,9 @@
* file that was distributed with this source code.
*/
-namespace Symfony\Tests\Component\Security\Authentication\Provider;
+namespace Symfony\Tests\Component\Security\Core\Authentication\Provider;
-use Symfony\Component\Security\Authentication\Provider\AnonymousAuthenticationProvider;
+use Symfony\Component\Security\Core\Authentication\Provider\AnonymousAuthenticationProvider;
class AnonymousAuthenticationProviderTest extends \PHPUnit_Framework_TestCase
{
@@ -20,18 +20,18 @@ class AnonymousAuthenticationProviderTest extends \PHPUnit_Framework_TestCase
$provider = $this->getProvider('foo');
$this->assertTrue($provider->supports($this->getSupportedToken('foo')));
- $this->assertFalse($provider->supports($this->getMock('Symfony\Component\Security\Authentication\Token\TokenInterface')));
+ $this->assertFalse($provider->supports($this->getMock('Symfony\Component\Security\Core\Authentication\Token\TokenInterface')));
}
public function testAuthenticateWhenTokenIsNotSupported()
{
$provider = $this->getProvider('foo');
- $this->assertNull($provider->authenticate($this->getMock('Symfony\Component\Security\Authentication\Token\TokenInterface')));
+ $this->assertNull($provider->authenticate($this->getMock('Symfony\Component\Security\Core\Authentication\Token\TokenInterface')));
}
/**
- * @expectedException Symfony\Component\Security\Exception\BadCredentialsException
+ * @expectedException Symfony\Component\Security\Core\Exception\BadCredentialsException
*/
public function testAuthenticateWhenKeyIsNotValid()
{
@@ -50,7 +50,7 @@ class AnonymousAuthenticationProviderTest extends \PHPUnit_Framework_TestCase
protected function getSupportedToken($key)
{
- $token = $this->getMock('Symfony\Component\Security\Authentication\Token\AnonymousToken', array('getKey'), array(), '', false);
+ $token = $this->getMock('Symfony\Component\Security\Core\Authentication\Token\AnonymousToken', array('getKey'), array(), '', false);
$token->expects($this->any())
->method('getKey')
->will($this->returnValue($key))
diff --git a/tests/Symfony/Tests/Component/Security/Authentication/Provider/DaoAuthenticationProviderTest.php b/tests/Symfony/Tests/Component/Security/Core/Authentication/Provider/DaoAuthenticationProviderTest.php
similarity index 72%
rename from tests/Symfony/Tests/Component/Security/Authentication/Provider/DaoAuthenticationProviderTest.php
rename to tests/Symfony/Tests/Component/Security/Core/Authentication/Provider/DaoAuthenticationProviderTest.php
index 76e7be9b65..7e472e446b 100644
--- a/tests/Symfony/Tests/Component/Security/Authentication/Provider/DaoAuthenticationProviderTest.php
+++ b/tests/Symfony/Tests/Component/Security/Core/Authentication/Provider/DaoAuthenticationProviderTest.php
@@ -9,18 +9,18 @@
* file that was distributed with this source code.
*/
-namespace Symfony\Tests\Component\Security\Authentication\Provider;
+namespace Symfony\Tests\Component\Security\Core\Authentication\Provider;
-use Symfony\Component\Security\Encoder\EncoderFactory;
+use Symfony\Component\Security\Core\Encoder\EncoderFactory;
-use Symfony\Component\Security\Encoder\PlaintextPasswordEncoder;
+use Symfony\Component\Security\Core\Encoder\PlaintextPasswordEncoder;
-use Symfony\Component\Security\Authentication\Provider\DaoAuthenticationProvider;
+use Symfony\Component\Security\Core\Authentication\Provider\DaoAuthenticationProvider;
class DaoAuthenticationProviderTest extends \PHPUnit_Framework_TestCase
{
/**
- * @expectedException Symfony\Component\Security\Exception\AuthenticationServiceException
+ * @expectedException Symfony\Component\Security\Core\Exception\AuthenticationServiceException
*/
public function testRetrieveUserWhenProviderDoesNotReturnAnAccountInterface()
{
@@ -32,17 +32,17 @@ class DaoAuthenticationProviderTest extends \PHPUnit_Framework_TestCase
}
/**
- * @expectedException Symfony\Component\Security\Exception\UsernameNotFoundException
+ * @expectedException Symfony\Component\Security\Core\Exception\UsernameNotFoundException
*/
public function testRetrieveUserWhenUsernameIsNotFound()
{
- $userProvider = $this->getMock('Symfony\Component\Security\User\UserProviderInterface');
+ $userProvider = $this->getMock('Symfony\Component\Security\Core\User\UserProviderInterface');
$userProvider->expects($this->once())
->method('loadUserByUsername')
- ->will($this->throwException($this->getMock('Symfony\Component\Security\Exception\UsernameNotFoundException', null, array(), '', false)))
+ ->will($this->throwException($this->getMock('Symfony\Component\Security\Core\Exception\UsernameNotFoundException', null, array(), '', false)))
;
- $provider = new DaoAuthenticationProvider($userProvider, $this->getMock('Symfony\Component\Security\User\AccountCheckerInterface'), 'key', $this->getMock('Symfony\Component\Security\Encoder\EncoderFactoryInterface'));
+ $provider = new DaoAuthenticationProvider($userProvider, $this->getMock('Symfony\Component\Security\Core\User\AccountCheckerInterface'), 'key', $this->getMock('Symfony\Component\Security\Core\Encoder\EncoderFactoryInterface'));
$method = new \ReflectionMethod($provider, 'retrieveUser');
$method->setAccessible(true);
@@ -50,17 +50,17 @@ class DaoAuthenticationProviderTest extends \PHPUnit_Framework_TestCase
}
/**
- * @expectedException Symfony\Component\Security\Exception\AuthenticationServiceException
+ * @expectedException Symfony\Component\Security\Core\Exception\AuthenticationServiceException
*/
public function testRetrieveUserWhenAnExceptionOccurs()
{
- $userProvider = $this->getMock('Symfony\Component\Security\User\UserProviderInterface');
+ $userProvider = $this->getMock('Symfony\Component\Security\Core\User\UserProviderInterface');
$userProvider->expects($this->once())
->method('loadUserByUsername')
->will($this->throwException($this->getMock('RuntimeException', null, array(), '', false)))
;
- $provider = new DaoAuthenticationProvider($userProvider, $this->getMock('Symfony\Component\Security\User\AccountCheckerInterface'), 'key', $this->getMock('Symfony\Component\Security\Encoder\EncoderFactoryInterface'));
+ $provider = new DaoAuthenticationProvider($userProvider, $this->getMock('Symfony\Component\Security\Core\User\AccountCheckerInterface'), 'key', $this->getMock('Symfony\Component\Security\Core\Encoder\EncoderFactoryInterface'));
$method = new \ReflectionMethod($provider, 'retrieveUser');
$method->setAccessible(true);
@@ -69,19 +69,19 @@ class DaoAuthenticationProviderTest extends \PHPUnit_Framework_TestCase
public function testRetrieveUserReturnsUserFromTokenOnReauthentication()
{
- $userProvider = $this->getMock('Symfony\Component\Security\User\UserProviderInterface');
+ $userProvider = $this->getMock('Symfony\Component\Security\Core\User\UserProviderInterface');
$userProvider->expects($this->never())
->method('loadUserByUsername')
;
- $user = $this->getMock('Symfony\Component\Security\User\AccountInterface');
+ $user = $this->getMock('Symfony\Component\Security\Core\User\AccountInterface');
$token = $this->getSupportedToken();
$token->expects($this->once())
->method('getUser')
->will($this->returnValue($user))
;
- $provider = new DaoAuthenticationProvider($userProvider, $this->getMock('Symfony\Component\Security\User\AccountCheckerInterface'), 'key', $this->getMock('Symfony\Component\Security\Encoder\EncoderFactoryInterface'));
+ $provider = new DaoAuthenticationProvider($userProvider, $this->getMock('Symfony\Component\Security\Core\User\AccountCheckerInterface'), 'key', $this->getMock('Symfony\Component\Security\Core\Encoder\EncoderFactoryInterface'));
$reflection = new \ReflectionMethod($provider, 'retrieveUser');
$reflection->setAccessible(true);
$result = $reflection->invoke($provider, null, $token);
@@ -91,15 +91,15 @@ class DaoAuthenticationProviderTest extends \PHPUnit_Framework_TestCase
public function testRetrieveUser()
{
- $user = $this->getMock('Symfony\Component\Security\User\AccountInterface');
+ $user = $this->getMock('Symfony\Component\Security\Core\User\AccountInterface');
- $userProvider = $this->getMock('Symfony\Component\Security\User\UserProviderInterface');
+ $userProvider = $this->getMock('Symfony\Component\Security\Core\User\UserProviderInterface');
$userProvider->expects($this->once())
->method('loadUserByUsername')
->will($this->returnValue($user))
;
- $provider = new DaoAuthenticationProvider($userProvider, $this->getMock('Symfony\Component\Security\User\AccountCheckerInterface'), 'key', $this->getMock('Symfony\Component\Security\Encoder\EncoderFactoryInterface'));
+ $provider = new DaoAuthenticationProvider($userProvider, $this->getMock('Symfony\Component\Security\Core\User\AccountCheckerInterface'), 'key', $this->getMock('Symfony\Component\Security\Core\Encoder\EncoderFactoryInterface'));
$method = new \ReflectionMethod($provider, 'retrieveUser');
$method->setAccessible(true);
@@ -107,7 +107,7 @@ class DaoAuthenticationProviderTest extends \PHPUnit_Framework_TestCase
}
/**
- * @expectedException Symfony\Component\Security\Exception\BadCredentialsException
+ * @expectedException Symfony\Component\Security\Core\Exception\BadCredentialsException
*/
public function testCheckAuthenticationWhenCredentialsAreEmpty()
{
@@ -121,15 +121,15 @@ class DaoAuthenticationProviderTest extends \PHPUnit_Framework_TestCase
->will($this->returnValue(''))
;
- $method->invoke($provider, $this->getMock('Symfony\Component\Security\User\AccountInterface'), $token);
+ $method->invoke($provider, $this->getMock('Symfony\Component\Security\Core\User\AccountInterface'), $token);
}
/**
- * @expectedException Symfony\Component\Security\Exception\BadCredentialsException
+ * @expectedException Symfony\Component\Security\Core\Exception\BadCredentialsException
*/
public function testCheckAuthenticationWhenCredentialsAreNotValid()
{
- $encoder = $this->getMock('Symfony\Component\Security\Encoder\PasswordEncoderInterface');
+ $encoder = $this->getMock('Symfony\Component\Security\Core\Encoder\PasswordEncoderInterface');
$encoder->expects($this->once())
->method('isPasswordValid')
->will($this->returnValue(false))
@@ -145,15 +145,15 @@ class DaoAuthenticationProviderTest extends \PHPUnit_Framework_TestCase
->will($this->returnValue('foo'))
;
- $method->invoke($provider, $this->getMock('Symfony\Component\Security\User\AccountInterface'), $token);
+ $method->invoke($provider, $this->getMock('Symfony\Component\Security\Core\User\AccountInterface'), $token);
}
/**
- * @expectedException Symfony\Component\Security\Exception\BadCredentialsException
+ * @expectedException Symfony\Component\Security\Core\Exception\BadCredentialsException
*/
public function testCheckAuthenticationDoesNotReauthenticateWhenPasswordHasChanged()
{
- $user = $this->getMock('Symfony\Component\Security\User\AccountInterface');
+ $user = $this->getMock('Symfony\Component\Security\Core\User\AccountInterface');
$user->expects($this->once())
->method('getPassword')
->will($this->returnValue('foo'))
@@ -164,7 +164,7 @@ class DaoAuthenticationProviderTest extends \PHPUnit_Framework_TestCase
->method('getUser')
->will($this->returnValue($user));
- $dbUser = $this->getMock('Symfony\Component\Security\User\AccountInterface');
+ $dbUser = $this->getMock('Symfony\Component\Security\Core\User\AccountInterface');
$dbUser->expects($this->once())
->method('getPassword')
->will($this->returnValue('newFoo'))
@@ -178,7 +178,7 @@ class DaoAuthenticationProviderTest extends \PHPUnit_Framework_TestCase
public function testCheckAuthenticationWhenTokenNeedsReauthenticationWorksWithoutOriginalCredentials()
{
- $user = $this->getMock('Symfony\Component\Security\User\AccountInterface');
+ $user = $this->getMock('Symfony\Component\Security\Core\User\AccountInterface');
$user->expects($this->once())
->method('getPassword')
->will($this->returnValue('foo'))
@@ -189,7 +189,7 @@ class DaoAuthenticationProviderTest extends \PHPUnit_Framework_TestCase
->method('getUser')
->will($this->returnValue($user));
- $dbUser = $this->getMock('Symfony\Component\Security\User\AccountInterface');
+ $dbUser = $this->getMock('Symfony\Component\Security\Core\User\AccountInterface');
$dbUser->expects($this->once())
->method('getPassword')
->will($this->returnValue('foo'))
@@ -203,7 +203,7 @@ class DaoAuthenticationProviderTest extends \PHPUnit_Framework_TestCase
public function testCheckAuthentication()
{
- $encoder = $this->getMock('Symfony\Component\Security\Encoder\PasswordEncoderInterface');
+ $encoder = $this->getMock('Symfony\Component\Security\Core\Encoder\PasswordEncoderInterface');
$encoder->expects($this->once())
->method('isPasswordValid')
->will($this->returnValue(true))
@@ -219,12 +219,12 @@ class DaoAuthenticationProviderTest extends \PHPUnit_Framework_TestCase
->will($this->returnValue('foo'))
;
- $method->invoke($provider, $this->getMock('Symfony\Component\Security\User\AccountInterface'), $token);
+ $method->invoke($provider, $this->getMock('Symfony\Component\Security\Core\User\AccountInterface'), $token);
}
protected function getSupportedToken()
{
- $mock = $this->getMock('Symfony\Component\Security\Authentication\Token\UsernamePasswordToken', array('getCredentials', 'getUser'), array(), '', false);
+ $mock = $this->getMock('Symfony\Component\Security\Core\Authentication\Token\UsernamePasswordToken', array('getCredentials', 'getUser'), array(), '', false);
$mock
->expects($this->any())
->method('getProviderKey')
@@ -236,7 +236,7 @@ class DaoAuthenticationProviderTest extends \PHPUnit_Framework_TestCase
protected function getProvider($user = false, $userChecker = false, $passwordEncoder = null)
{
- $userProvider = $this->getMock('Symfony\Component\Security\User\UserProviderInterface');
+ $userProvider = $this->getMock('Symfony\Component\Security\Core\User\UserProviderInterface');
if (false !== $user) {
$userProvider->expects($this->once())
->method('loadUserByUsername')
@@ -245,14 +245,14 @@ class DaoAuthenticationProviderTest extends \PHPUnit_Framework_TestCase
}
if (false === $userChecker) {
- $userChecker = $this->getMock('Symfony\Component\Security\User\AccountCheckerInterface');
+ $userChecker = $this->getMock('Symfony\Component\Security\Core\User\AccountCheckerInterface');
}
if (null === $passwordEncoder) {
$passwordEncoder = new PlaintextPasswordEncoder();
}
- $encoderFactory = $this->getMock('Symfony\Component\Security\Encoder\EncoderFactoryInterface');
+ $encoderFactory = $this->getMock('Symfony\Component\Security\Core\Encoder\EncoderFactoryInterface');
$encoderFactory
->expects($this->any())
->method('getEncoder')
diff --git a/tests/Symfony/Tests/Component/Security/Authentication/Provider/PreAuthenticatedAuthenticationProviderTest.php b/tests/Symfony/Tests/Component/Security/Core/Authentication/Provider/PreAuthenticatedAuthenticationProviderTest.php
similarity index 73%
rename from tests/Symfony/Tests/Component/Security/Authentication/Provider/PreAuthenticatedAuthenticationProviderTest.php
rename to tests/Symfony/Tests/Component/Security/Core/Authentication/Provider/PreAuthenticatedAuthenticationProviderTest.php
index 4e56d54271..712fdc8b59 100644
--- a/tests/Symfony/Tests/Component/Security/Authentication/Provider/PreAuthenticatedAuthenticationProviderTest.php
+++ b/tests/Symfony/Tests/Component/Security/Core/Authentication/Provider/PreAuthenticatedAuthenticationProviderTest.php
@@ -9,9 +9,9 @@
* file that was distributed with this source code.
*/
-namespace Symfony\Tests\Component\Security\Authentication\Provider;
+namespace Symfony\Tests\Component\Security\Core\Authentication\Provider;
-use Symfony\Component\Security\Authentication\Provider\PreAuthenticatedAuthenticationProvider;
+use Symfony\Component\Security\Core\Authentication\Provider\PreAuthenticatedAuthenticationProvider;
class PreAuthenticatedAuthenticationProviderTest extends \PHPUnit_Framework_TestCase
{
@@ -20,9 +20,9 @@ class PreAuthenticatedAuthenticationProviderTest extends \PHPUnit_Framework_Test
$provider = $this->getProvider();
$this->assertTrue($provider->supports($this->getSupportedToken()));
- $this->assertFalse($provider->supports($this->getMock('Symfony\Component\Security\Authentication\Token\TokenInterface')));
+ $this->assertFalse($provider->supports($this->getMock('Symfony\Component\Security\Core\Authentication\Token\TokenInterface')));
- $token = $this->getMockBuilder('Symfony\Component\Security\Authentication\Token\PreAuthenticatedToken')
+ $token = $this->getMockBuilder('Symfony\Component\Security\Core\Authentication\Token\PreAuthenticatedToken')
->disableOriginalConstructor()
->getMock()
;
@@ -38,11 +38,11 @@ class PreAuthenticatedAuthenticationProviderTest extends \PHPUnit_Framework_Test
{
$provider = $this->getProvider();
- $this->assertNull($provider->authenticate($this->getMock('Symfony\Component\Security\Authentication\Token\TokenInterface')));
+ $this->assertNull($provider->authenticate($this->getMock('Symfony\Component\Security\Core\Authentication\Token\TokenInterface')));
}
/**
- * @expectedException Symfony\Component\Security\Exception\BadCredentialsException
+ * @expectedException Symfony\Component\Security\Core\Exception\BadCredentialsException
*/
public function testAuthenticateWhenNoUserIsSet()
{
@@ -52,27 +52,27 @@ class PreAuthenticatedAuthenticationProviderTest extends \PHPUnit_Framework_Test
public function testAuthenticate()
{
- $user = $this->getMock('Symfony\Component\Security\User\AccountInterface');
+ $user = $this->getMock('Symfony\Component\Security\Core\User\AccountInterface');
$provider = $this->getProvider($user);
$token = $provider->authenticate($this->getSupportedToken('fabien', 'pass'));
- $this->assertInstanceOf('Symfony\Component\Security\Authentication\Token\PreAuthenticatedToken', $token);
+ $this->assertInstanceOf('Symfony\Component\Security\Core\Authentication\Token\PreAuthenticatedToken', $token);
$this->assertEquals('pass', $token->getCredentials());
$this->assertEquals(array(), $token->getRoles());
$this->assertSame($user, $token->getUser());
}
/**
- * @expectedException Symfony\Component\Security\Exception\LockedException
+ * @expectedException Symfony\Component\Security\Core\Exception\LockedException
*/
public function testAuthenticateWhenAccountCheckerThrowsException()
{
- $user = $this->getMock('Symfony\Component\Security\User\AccountInterface');
+ $user = $this->getMock('Symfony\Component\Security\Core\User\AccountInterface');
- $userChecker = $this->getMock('Symfony\Component\Security\User\AccountCheckerInterface');
+ $userChecker = $this->getMock('Symfony\Component\Security\Core\User\AccountCheckerInterface');
$userChecker->expects($this->once())
->method('checkPostAuth')
- ->will($this->throwException($this->getMock('Symfony\Component\Security\Exception\LockedException', null, array(), '', false)))
+ ->will($this->throwException($this->getMock('Symfony\Component\Security\Core\Exception\LockedException', null, array(), '', false)))
;
$provider = $this->getProvider($user, $userChecker);
@@ -82,7 +82,7 @@ class PreAuthenticatedAuthenticationProviderTest extends \PHPUnit_Framework_Test
protected function getSupportedToken($user = false, $credentials = false)
{
- $token = $this->getMock('Symfony\Component\Security\Authentication\Token\PreAuthenticatedToken', array('getUser', 'getCredentials', 'getProviderKey'), array(), '', false);
+ $token = $this->getMock('Symfony\Component\Security\Core\Authentication\Token\PreAuthenticatedToken', array('getUser', 'getCredentials', 'getProviderKey'), array(), '', false);
if (false !== $user) {
$token->expects($this->once())
->method('getUser')
@@ -107,7 +107,7 @@ class PreAuthenticatedAuthenticationProviderTest extends \PHPUnit_Framework_Test
protected function getProvider($user = false, $userChecker = false)
{
- $userProvider = $this->getMock('Symfony\Component\Security\User\UserProviderInterface');
+ $userProvider = $this->getMock('Symfony\Component\Security\Core\User\UserProviderInterface');
if (false !== $user) {
$userProvider->expects($this->once())
->method('loadUserByUsername')
@@ -116,7 +116,7 @@ class PreAuthenticatedAuthenticationProviderTest extends \PHPUnit_Framework_Test
}
if (false === $userChecker) {
- $userChecker = $this->getMock('Symfony\Component\Security\User\AccountCheckerInterface');
+ $userChecker = $this->getMock('Symfony\Component\Security\Core\User\AccountCheckerInterface');
}
return new PreAuthenticatedAuthenticationProvider($userProvider, $userChecker, 'key');
diff --git a/tests/Symfony/Tests/Component/Security/Authentication/Provider/RememberMeAuthenticationProviderTest.php b/tests/Symfony/Tests/Component/Security/Core/Authentication/Provider/RememberMeAuthenticationProviderTest.php
similarity index 66%
rename from tests/Symfony/Tests/Component/Security/Authentication/Provider/RememberMeAuthenticationProviderTest.php
rename to tests/Symfony/Tests/Component/Security/Core/Authentication/Provider/RememberMeAuthenticationProviderTest.php
index f7e09f06a3..290bb466b5 100644
--- a/tests/Symfony/Tests/Component/Security/Authentication/Provider/RememberMeAuthenticationProviderTest.php
+++ b/tests/Symfony/Tests/Component/Security/Core/Authentication/Provider/RememberMeAuthenticationProviderTest.php
@@ -1,10 +1,10 @@
getProvider();
$this->assertTrue($provider->supports($this->getSupportedToken()));
- $this->assertFalse($provider->supports($this->getMock('Symfony\Component\Security\Authentication\Token\TokenInterface')));
+ $this->assertFalse($provider->supports($this->getMock('Symfony\Component\Security\Core\Authentication\Token\TokenInterface')));
}
public function testAuthenticateWhenTokenIsNotSupported()
{
$provider = $this->getProvider();
- $token = $this->getMock('Symfony\Component\Security\Authentication\Token\TokenInterface');
+ $token = $this->getMock('Symfony\Component\Security\Core\Authentication\Token\TokenInterface');
$this->assertNull($provider->authenticate($token));
}
/**
- * @expectedException Symfony\Component\Security\Exception\BadCredentialsException
+ * @expectedException Symfony\Component\Security\Core\Exception\BadCredentialsException
*/
public function testAuthenticateWhenKeysDoNotMatch()
{
@@ -36,14 +36,14 @@ class RememberMeAuthenticationProviderTest extends \PHPUnit_Framework_TestCase
}
/**
- * @expectedException Symfony\Component\Security\Exception\CredentialsExpiredException
+ * @expectedException Symfony\Component\Security\Core\Exception\CredentialsExpiredException
*/
public function testAuthenticateWhenPreChecksFails()
{
- $userChecker = $this->getMock('Symfony\Component\Security\User\AccountCheckerInterface');
+ $userChecker = $this->getMock('Symfony\Component\Security\Core\User\AccountCheckerInterface');
$userChecker->expects($this->once())
->method('checkPreAuth')
- ->will($this->throwException($this->getMock('Symfony\Component\Security\Exception\CredentialsExpiredException', null, array(), '', false)))
+ ->will($this->throwException($this->getMock('Symfony\Component\Security\Core\Exception\CredentialsExpiredException', null, array(), '', false)))
;
$provider = $this->getProvider($userChecker);
@@ -52,14 +52,14 @@ class RememberMeAuthenticationProviderTest extends \PHPUnit_Framework_TestCase
}
/**
- * @expectedException Symfony\Component\Security\Exception\AccountExpiredException
+ * @expectedException Symfony\Component\Security\Core\Exception\AccountExpiredException
*/
public function testAuthenticateWhenPostChecksFails()
{
- $userChecker = $this->getMock('Symfony\Component\Security\User\AccountCheckerInterface');
+ $userChecker = $this->getMock('Symfony\Component\Security\Core\User\AccountCheckerInterface');
$userChecker->expects($this->once())
->method('checkPostAuth')
- ->will($this->throwException($this->getMock('Symfony\Component\Security\Exception\AccountExpiredException', null, array(), '', false)))
+ ->will($this->throwException($this->getMock('Symfony\Component\Security\Core\Exception\AccountExpiredException', null, array(), '', false)))
;
$provider = $this->getProvider($userChecker);
@@ -69,7 +69,7 @@ class RememberMeAuthenticationProviderTest extends \PHPUnit_Framework_TestCase
public function testAuthenticate()
{
- $user = $this->getMock('Symfony\Component\Security\User\AccountInterface');
+ $user = $this->getMock('Symfony\Component\Security\Core\User\AccountInterface');
$user->expects($this->once())
->method('getRoles')
->will($this->returnValue(array('ROLE_FOO')))
@@ -86,7 +86,7 @@ class RememberMeAuthenticationProviderTest extends \PHPUnit_Framework_TestCase
$authToken = $provider->authenticate($token);
- $this->assertInstanceOf('Symfony\Component\Security\Authentication\Token\RememberMeToken', $authToken);
+ $this->assertInstanceOf('Symfony\Component\Security\Core\Authentication\Token\RememberMeToken', $authToken);
$this->assertSame($user, $authToken->getUser());
$this->assertEquals(array(new Role('ROLE_FOO')), $authToken->getRoles());
$this->assertEquals('foo', $authToken->getCredentials());
@@ -95,7 +95,7 @@ class RememberMeAuthenticationProviderTest extends \PHPUnit_Framework_TestCase
protected function getSupportedToken($user = null, $key = 'test')
{
if (null === $user) {
- $user = $this->getMock('Symfony\Component\Security\User\AccountInterface');
+ $user = $this->getMock('Symfony\Component\Security\Core\User\AccountInterface');
$user
->expects($this->any())
->method('getRoles')
@@ -103,7 +103,7 @@ class RememberMeAuthenticationProviderTest extends \PHPUnit_Framework_TestCase
;
}
- $token = $this->getMock('Symfony\Component\Security\Authentication\Token\RememberMeToken', array('getCredentials', 'getProviderKey'), array($user, 'foo', $key));
+ $token = $this->getMock('Symfony\Component\Security\Core\Authentication\Token\RememberMeToken', array('getCredentials', 'getProviderKey'), array($user, 'foo', $key));
$token
->expects($this->once())
->method('getProviderKey')
@@ -116,7 +116,7 @@ class RememberMeAuthenticationProviderTest extends \PHPUnit_Framework_TestCase
protected function getProvider($userChecker = null, $key = 'test')
{
if (null === $userChecker) {
- $userChecker = $this->getMock('Symfony\Component\Security\User\AccountCheckerInterface');
+ $userChecker = $this->getMock('Symfony\Component\Security\Core\User\AccountCheckerInterface');
}
return new RememberMeAuthenticationProvider($userChecker, $key, 'foo');
diff --git a/tests/Symfony/Tests/Component/Security/Authentication/Provider/UserAuthenticationProviderTest.php b/tests/Symfony/Tests/Component/Security/Core/Authentication/Provider/UserAuthenticationProviderTest.php
similarity index 69%
rename from tests/Symfony/Tests/Component/Security/Authentication/Provider/UserAuthenticationProviderTest.php
rename to tests/Symfony/Tests/Component/Security/Core/Authentication/Provider/UserAuthenticationProviderTest.php
index 5ced1c045a..5c72920a32 100644
--- a/tests/Symfony/Tests/Component/Security/Authentication/Provider/UserAuthenticationProviderTest.php
+++ b/tests/Symfony/Tests/Component/Security/Core/Authentication/Provider/UserAuthenticationProviderTest.php
@@ -9,10 +9,10 @@
* file that was distributed with this source code.
*/
-namespace Symfony\Tests\Component\Security\Authentication\Provider;
+namespace Symfony\Tests\Component\Security\Core\Authentication\Provider;
-use Symfony\Component\Security\Authentication\Provider\UserAuthenticationProvider;
-use Symfony\Component\Security\Role\Role;
+use Symfony\Component\Security\Core\Authentication\Provider\UserAuthenticationProvider;
+use Symfony\Component\Security\Core\Role\Role;
class UserAuthenticationProviderTest extends \PHPUnit_Framework_TestCase
{
@@ -21,46 +21,46 @@ class UserAuthenticationProviderTest extends \PHPUnit_Framework_TestCase
$provider = $this->getProvider();
$this->assertTrue($provider->supports($this->getSupportedToken()));
- $this->assertFalse($provider->supports($this->getMock('Symfony\Component\Security\Authentication\Token\TokenInterface')));
+ $this->assertFalse($provider->supports($this->getMock('Symfony\Component\Security\Core\Authentication\Token\TokenInterface')));
}
public function testAuthenticateWhenTokenIsNotSupported()
{
$provider = $this->getProvider();
- $this->assertNull($provider->authenticate($this->getMock('Symfony\Component\Security\Authentication\Token\TokenInterface')));
+ $this->assertNull($provider->authenticate($this->getMock('Symfony\Component\Security\Core\Authentication\Token\TokenInterface')));
}
/**
- * @expectedException Symfony\Component\Security\Exception\UsernameNotFoundException
+ * @expectedException Symfony\Component\Security\Core\Exception\UsernameNotFoundException
*/
public function testAuthenticateWhenUsernameIsNotFound()
{
$provider = $this->getProvider(false, false);
$provider->expects($this->once())
->method('retrieveUser')
- ->will($this->throwException($this->getMock('Symfony\Component\Security\Exception\UsernameNotFoundException', null, array(), '', false)))
+ ->will($this->throwException($this->getMock('Symfony\Component\Security\Core\Exception\UsernameNotFoundException', null, array(), '', false)))
;
$provider->authenticate($this->getSupportedToken());
}
/**
- * @expectedException Symfony\Component\Security\Exception\BadCredentialsException
+ * @expectedException Symfony\Component\Security\Core\Exception\BadCredentialsException
*/
public function testAuthenticateWhenUsernameIsNotFoundAndHideIsTrue()
{
$provider = $this->getProvider(false, true);
$provider->expects($this->once())
->method('retrieveUser')
- ->will($this->throwException($this->getMock('Symfony\Component\Security\Exception\UsernameNotFoundException', null, array(), '', false)))
+ ->will($this->throwException($this->getMock('Symfony\Component\Security\Core\Exception\UsernameNotFoundException', null, array(), '', false)))
;
$provider->authenticate($this->getSupportedToken());
}
/**
- * @expectedException Symfony\Component\Security\Exception\AuthenticationServiceException
+ * @expectedException Symfony\Component\Security\Core\Exception\AuthenticationServiceException
*/
public function testAuthenticateWhenProviderDoesNotReturnAnAccountInterface()
{
@@ -74,58 +74,58 @@ class UserAuthenticationProviderTest extends \PHPUnit_Framework_TestCase
}
/**
- * @expectedException Symfony\Component\Security\Exception\CredentialsExpiredException
+ * @expectedException Symfony\Component\Security\Core\Exception\CredentialsExpiredException
*/
public function testAuthenticateWhenPreChecksFails()
{
- $userChecker = $this->getMock('Symfony\Component\Security\User\AccountCheckerInterface');
+ $userChecker = $this->getMock('Symfony\Component\Security\Core\User\AccountCheckerInterface');
$userChecker->expects($this->once())
->method('checkPreAuth')
- ->will($this->throwException($this->getMock('Symfony\Component\Security\Exception\CredentialsExpiredException', null, array(), '', false)))
+ ->will($this->throwException($this->getMock('Symfony\Component\Security\Core\Exception\CredentialsExpiredException', null, array(), '', false)))
;
$provider = $this->getProvider($userChecker);
$provider->expects($this->once())
->method('retrieveUser')
- ->will($this->returnValue($this->getMock('Symfony\Component\Security\User\AccountInterface')))
+ ->will($this->returnValue($this->getMock('Symfony\Component\Security\Core\User\AccountInterface')))
;
$provider->authenticate($this->getSupportedToken());
}
/**
- * @expectedException Symfony\Component\Security\Exception\AccountExpiredException
+ * @expectedException Symfony\Component\Security\Core\Exception\AccountExpiredException
*/
public function testAuthenticateWhenPostChecksFails()
{
- $userChecker = $this->getMock('Symfony\Component\Security\User\AccountCheckerInterface');
+ $userChecker = $this->getMock('Symfony\Component\Security\Core\User\AccountCheckerInterface');
$userChecker->expects($this->once())
->method('checkPostAuth')
- ->will($this->throwException($this->getMock('Symfony\Component\Security\Exception\AccountExpiredException', null, array(), '', false)))
+ ->will($this->throwException($this->getMock('Symfony\Component\Security\Core\Exception\AccountExpiredException', null, array(), '', false)))
;
$provider = $this->getProvider($userChecker);
$provider->expects($this->once())
->method('retrieveUser')
- ->will($this->returnValue($this->getMock('Symfony\Component\Security\User\AccountInterface')))
+ ->will($this->returnValue($this->getMock('Symfony\Component\Security\Core\User\AccountInterface')))
;
$provider->authenticate($this->getSupportedToken());
}
/**
- * @expectedException Symfony\Component\Security\Exception\BadCredentialsException
+ * @expectedException Symfony\Component\Security\Core\Exception\BadCredentialsException
*/
public function testAuthenticateWhenPostCheckAuthenticationFails()
{
$provider = $this->getProvider();
$provider->expects($this->once())
->method('retrieveUser')
- ->will($this->returnValue($this->getMock('Symfony\Component\Security\User\AccountInterface')))
+ ->will($this->returnValue($this->getMock('Symfony\Component\Security\Core\User\AccountInterface')))
;
$provider->expects($this->once())
->method('checkAuthentication')
- ->will($this->throwException($this->getMock('Symfony\Component\Security\Exception\BadCredentialsException', null, array(), '', false)))
+ ->will($this->throwException($this->getMock('Symfony\Component\Security\Core\Exception\BadCredentialsException', null, array(), '', false)))
;
$provider->authenticate($this->getSupportedToken());
@@ -133,7 +133,7 @@ class UserAuthenticationProviderTest extends \PHPUnit_Framework_TestCase
public function testAuthenticate()
{
- $user = $this->getMock('Symfony\Component\Security\User\AccountInterface');
+ $user = $this->getMock('Symfony\Component\Security\Core\User\AccountInterface');
$user->expects($this->once())
->method('getRoles')
->will($this->returnValue(array('ROLE_FOO')))
@@ -153,7 +153,7 @@ class UserAuthenticationProviderTest extends \PHPUnit_Framework_TestCase
$authToken = $provider->authenticate($token);
- $this->assertInstanceOf('Symfony\Component\Security\Authentication\Token\UsernamePasswordToken', $authToken);
+ $this->assertInstanceOf('Symfony\Component\Security\Core\Authentication\Token\UsernamePasswordToken', $authToken);
$this->assertSame($user, $authToken->getUser());
$this->assertEquals(array(new Role('ROLE_FOO')), $authToken->getRoles());
$this->assertEquals('foo', $authToken->getCredentials());
@@ -161,7 +161,7 @@ class UserAuthenticationProviderTest extends \PHPUnit_Framework_TestCase
protected function getSupportedToken()
{
- $mock = $this->getMock('Symfony\Component\Security\Authentication\Token\UsernamePasswordToken', array('getCredentials', 'getProviderKey'), array(), '', false);
+ $mock = $this->getMock('Symfony\Component\Security\Core\Authentication\Token\UsernamePasswordToken', array('getCredentials', 'getProviderKey'), array(), '', false);
$mock
->expects($this->any())
->method('getProviderKey')
@@ -174,9 +174,9 @@ class UserAuthenticationProviderTest extends \PHPUnit_Framework_TestCase
protected function getProvider($userChecker = false, $hide = true)
{
if (false === $userChecker) {
- $userChecker = $this->getMock('Symfony\Component\Security\User\AccountCheckerInterface');
+ $userChecker = $this->getMock('Symfony\Component\Security\Core\User\AccountCheckerInterface');
}
- return $this->getMockForAbstractClass('Symfony\Component\Security\Authentication\Provider\UserAuthenticationProvider', array($userChecker, 'key', $hide));
+ return $this->getMockForAbstractClass('Symfony\Component\Security\Core\Authentication\Provider\UserAuthenticationProvider', array($userChecker, 'key', $hide));
}
}
diff --git a/tests/Symfony/Tests/Component/Security/Authentication/RememberMe/InMemoryTokenProviderTest.php b/tests/Symfony/Tests/Component/Security/Core/Authentication/RememberMe/InMemoryTokenProviderTest.php
similarity index 76%
rename from tests/Symfony/Tests/Component/Security/Authentication/RememberMe/InMemoryTokenProviderTest.php
rename to tests/Symfony/Tests/Component/Security/Core/Authentication/RememberMe/InMemoryTokenProviderTest.php
index 04053fa218..f1dd376d47 100644
--- a/tests/Symfony/Tests/Component/Security/Authentication/RememberMe/InMemoryTokenProviderTest.php
+++ b/tests/Symfony/Tests/Component/Security/Core/Authentication/RememberMe/InMemoryTokenProviderTest.php
@@ -1,9 +1,9 @@
getUser(), 'fookey', 'foo');
- $persistentToken = $this->getMock('Symfony\Component\Security\Authentication\RememberMe\PersistentTokenInterface');
+ $persistentToken = $this->getMock('Symfony\Component\Security\Core\Authentication\RememberMe\PersistentTokenInterface');
$this->assertNull($token->getPersistentToken());
$token->setPersistentToken($persistentToken);
@@ -72,7 +72,7 @@ class RememberMeTokenTest extends \PHPUnit_Framework_TestCase
protected function getUser($roles = array('ROLE_FOO'))
{
- $user = $this->getMock('Symfony\Component\Security\User\AccountInterface');
+ $user = $this->getMock('Symfony\Component\Security\Core\User\AccountInterface');
$user
->expects($this->once())
->method('getRoles')
diff --git a/tests/Symfony/Tests/Component/Security/Authentication/Token/TokenTest.php b/tests/Symfony/Tests/Component/Security/Core/Authentication/Token/TokenTest.php
similarity index 78%
rename from tests/Symfony/Tests/Component/Security/Authentication/Token/TokenTest.php
rename to tests/Symfony/Tests/Component/Security/Core/Authentication/Token/TokenTest.php
index adddba3483..597ac4e551 100644
--- a/tests/Symfony/Tests/Component/Security/Authentication/Token/TokenTest.php
+++ b/tests/Symfony/Tests/Component/Security/Core/Authentication/Token/TokenTest.php
@@ -9,10 +9,10 @@
* file that was distributed with this source code.
*/
-namespace Symfony\Tests\Component\Security\Authentication\Token;
+namespace Symfony\Tests\Component\Security\Core\Authentication\Token;
-use Symfony\Component\Security\Authentication\Token\Token as BaseToken;
-use Symfony\Component\Security\Role\Role;
+use Symfony\Component\Security\Core\Authentication\Token\Token as BaseToken;
+use Symfony\Component\Security\Core\Role\Role;
class Token extends BaseToken
{
@@ -48,7 +48,7 @@ class TokenTest extends \PHPUnit_Framework_TestCase
$token->setUser(new TestUser('fabien'));
$this->assertEquals('n/a', (string) $token);
- $user = $this->getMock('Symfony\Component\Security\User\AccountInterface');
+ $user = $this->getMock('Symfony\Component\Security\Core\User\AccountInterface');
$user->expects($this->once())->method('getUsername')->will($this->returnValue('fabien'));
$token->setUser($user);
@@ -59,11 +59,11 @@ class TokenTest extends \PHPUnit_Framework_TestCase
{
$token = new Token(array('ROLE_FOO'));
- $credentials = $this->getMock('Symfony\Component\Security\User\AccountInterface');
+ $credentials = $this->getMock('Symfony\Component\Security\Core\User\AccountInterface');
$credentials->expects($this->once())->method('eraseCredentials');
$token->setCredentials($credentials);
- $user = $this->getMock('Symfony\Component\Security\User\AccountInterface');
+ $user = $this->getMock('Symfony\Component\Security\Core\User\AccountInterface');
$user->expects($this->once())->method('eraseCredentials');
$token->setUser($user);
@@ -78,7 +78,7 @@ class TokenTest extends \PHPUnit_Framework_TestCase
}
/**
- * @covers Symfony\Component\Security\Authentication\Token\Token::__construct
+ * @covers Symfony\Component\Security\Core\Authentication\Token\Token::__construct
*/
public function testConstructor()
{
@@ -93,8 +93,8 @@ class TokenTest extends \PHPUnit_Framework_TestCase
}
/**
- * @covers Symfony\Component\Security\Authentication\Token\Token::addRole
- * @covers Symfony\Component\Security\Authentication\Token\Token::getRoles
+ * @covers Symfony\Component\Security\Core\Authentication\Token\Token::addRole
+ * @covers Symfony\Component\Security\Core\Authentication\Token\Token::getRoles
*/
public function testAddRole()
{
@@ -107,8 +107,8 @@ class TokenTest extends \PHPUnit_Framework_TestCase
}
/**
- * @covers Symfony\Component\Security\Authentication\Token\Token::isAuthenticated
- * @covers Symfony\Component\Security\Authentication\Token\Token::setAuthenticated
+ * @covers Symfony\Component\Security\Core\Authentication\Token\Token::isAuthenticated
+ * @covers Symfony\Component\Security\Core\Authentication\Token\Token::setAuthenticated
*/
public function testAuthenticatedFlag()
{
@@ -123,8 +123,8 @@ class TokenTest extends \PHPUnit_Framework_TestCase
}
/**
- * @covers Symfony\Component\Security\Authentication\Token\Token::isImmutable
- * @covers Symfony\Component\Security\Authentication\Token\Token::setImmutable
+ * @covers Symfony\Component\Security\Core\Authentication\Token\Token::isImmutable
+ * @covers Symfony\Component\Security\Core\Authentication\Token\Token::setImmutable
*/
public function testImmutableFlag()
{
diff --git a/tests/Symfony/Tests/Component/Security/Authentication/Token/UsernamePasswordTokenTest.php b/tests/Symfony/Tests/Component/Security/Core/Authentication/Token/UsernamePasswordTokenTest.php
similarity index 87%
rename from tests/Symfony/Tests/Component/Security/Authentication/Token/UsernamePasswordTokenTest.php
rename to tests/Symfony/Tests/Component/Security/Core/Authentication/Token/UsernamePasswordTokenTest.php
index 56624c1ad5..eac54a8c0c 100644
--- a/tests/Symfony/Tests/Component/Security/Authentication/Token/UsernamePasswordTokenTest.php
+++ b/tests/Symfony/Tests/Component/Security/Core/Authentication/Token/UsernamePasswordTokenTest.php
@@ -9,10 +9,10 @@
* file that was distributed with this source code.
*/
-namespace Symfony\Tests\Component\Security\Authentication\Token;
+namespace Symfony\Tests\Component\Security\Core\Authentication\Token;
-use Symfony\Component\Security\Authentication\Token\UsernamePasswordToken;
-use Symfony\Component\Security\Role\Role;
+use Symfony\Component\Security\Core\Authentication\Token\UsernamePasswordToken;
+use Symfony\Component\Security\Core\Role\Role;
class UsernamePasswordTokenTest extends \PHPUnit_Framework_TestCase
{
diff --git a/tests/Symfony/Tests/Component/Security/Authorization/AccessDecisionManagerTest.php b/tests/Symfony/Tests/Component/Security/Core/Authorization/AccessDecisionManagerTest.php
similarity index 90%
rename from tests/Symfony/Tests/Component/Security/Authorization/AccessDecisionManagerTest.php
rename to tests/Symfony/Tests/Component/Security/Core/Authorization/AccessDecisionManagerTest.php
index 6cd733ce3a..e05dcd21a7 100644
--- a/tests/Symfony/Tests/Component/Security/Authorization/AccessDecisionManagerTest.php
+++ b/tests/Symfony/Tests/Component/Security/Core/Authorization/AccessDecisionManagerTest.php
@@ -9,10 +9,10 @@
* file that was distributed with this source code.
*/
-namespace Symfony\Tests\Component\Security\Authorization;
+namespace Symfony\Tests\Component\Security\Core\Authorization;
-use Symfony\Component\Security\Authorization\AccessDecisionManager;
-use Symfony\Component\Security\Authorization\Voter\VoterInterface;
+use Symfony\Component\Security\Core\Authorization\AccessDecisionManager;
+use Symfony\Component\Security\Core\Authorization\Voter\VoterInterface;
class AccessDecisionManagerTest extends \PHPUnit_Framework_TestCase
{
@@ -75,7 +75,7 @@ class AccessDecisionManagerTest extends \PHPUnit_Framework_TestCase
*/
public function testStrategies($strategy, $voters, $allowIfAllAbstainDecisions, $allowIfEqualGrantedDeniedDecisions, $expected)
{
- $token = $this->getMock('Symfony\Component\Security\Authentication\Token\TokenInterface');
+ $token = $this->getMock('Symfony\Component\Security\Core\Authentication\Token\TokenInterface');
$manager = new AccessDecisionManager($voters, $strategy, $allowIfAllAbstainDecisions, $allowIfEqualGrantedDeniedDecisions);
$this->assertSame($expected, $manager->decide($token, array('ROLE_FOO')));
@@ -140,7 +140,7 @@ class AccessDecisionManagerTest extends \PHPUnit_Framework_TestCase
protected function getVoter($vote)
{
- $voter = $this->getMock('Symfony\Component\Security\Authorization\Voter\VoterInterface');
+ $voter = $this->getMock('Symfony\Component\Security\Core\Authorization\Voter\VoterInterface');
$voter->expects($this->any())
->method('vote')
->will($this->returnValue($vote));
@@ -151,7 +151,7 @@ class AccessDecisionManagerTest extends \PHPUnit_Framework_TestCase
protected function getVoterSupportsClass($ret)
{
- $voter = $this->getMock('Symfony\Component\Security\Authorization\Voter\VoterInterface');
+ $voter = $this->getMock('Symfony\Component\Security\Core\Authorization\Voter\VoterInterface');
$voter->expects($this->any())
->method('supportsClass')
->will($this->returnValue($ret));
@@ -162,7 +162,7 @@ class AccessDecisionManagerTest extends \PHPUnit_Framework_TestCase
protected function getVoterSupportsAttribute($ret)
{
- $voter = $this->getMock('Symfony\Component\Security\Authorization\Voter\VoterInterface');
+ $voter = $this->getMock('Symfony\Component\Security\Core\Authorization\Voter\VoterInterface');
$voter->expects($this->any())
->method('supportsAttribute')
->will($this->returnValue($ret));
diff --git a/tests/Symfony/Tests/Component/Security/Authorization/Voter/AuthenticatedVoterTest.php b/tests/Symfony/Tests/Component/Security/Core/Authorization/Voter/AuthenticatedVoterTest.php
similarity index 73%
rename from tests/Symfony/Tests/Component/Security/Authorization/Voter/AuthenticatedVoterTest.php
rename to tests/Symfony/Tests/Component/Security/Core/Authorization/Voter/AuthenticatedVoterTest.php
index 27a0f2c85e..389fb5c982 100644
--- a/tests/Symfony/Tests/Component/Security/Authorization/Voter/AuthenticatedVoterTest.php
+++ b/tests/Symfony/Tests/Component/Security/Core/Authorization/Voter/AuthenticatedVoterTest.php
@@ -9,12 +9,12 @@
* file that was distributed with this source code.
*/
-namespace Symfony\Tests\Component\Security\Authorization\Voter;
+namespace Symfony\Tests\Component\Security\Core\Authorization\Voter;
-use Symfony\Component\Security\Authentication\AuthenticationTrustResolver;
-use Symfony\Component\Security\Authorization\Voter\AuthenticatedVoter;
-use Symfony\Component\Security\Authorization\Voter\VoterInterface;
-use Symfony\Component\Security\Role\Role;
+use Symfony\Component\Security\Core\Authentication\AuthenticationTrustResolver;
+use Symfony\Component\Security\Core\Authorization\Voter\AuthenticatedVoter;
+use Symfony\Component\Security\Core\Authorization\Voter\VoterInterface;
+use Symfony\Component\Security\Core\Role\Role;
class AuthenticatedVoterTest extends \PHPUnit_Framework_TestCase
{
@@ -61,19 +61,19 @@ class AuthenticatedVoterTest extends \PHPUnit_Framework_TestCase
protected function getResolver()
{
return new AuthenticationTrustResolver(
- 'Symfony\\Component\\Security\\Authentication\\Token\\AnonymousToken',
- 'Symfony\\Component\\Security\\Authentication\\Token\\RememberMeToken'
+ 'Symfony\\Component\\Security\\Core\\Authentication\\Token\\AnonymousToken',
+ 'Symfony\\Component\\Security\\Core\\Authentication\\Token\\RememberMeToken'
);
}
protected function getToken($authenticated)
{
if ('fully' === $authenticated) {
- return $this->getMock('Symfony\Component\Security\Authentication\Token\TokenInterface');
+ return $this->getMock('Symfony\Component\Security\Core\Authentication\Token\TokenInterface');
} else if ('remembered' === $authenticated) {
- return $this->getMock('Symfony\Component\Security\Authentication\Token\RememberMeToken', array('setPersistent'), array(), '', false);
+ return $this->getMock('Symfony\Component\Security\Core\Authentication\Token\RememberMeToken', array('setPersistent'), array(), '', false);
} else {
- return $this->getMock('Symfony\Component\Security\Authentication\Token\AnonymousToken', null, array('', ''));
+ return $this->getMock('Symfony\Component\Security\Core\Authentication\Token\AnonymousToken', null, array('', ''));
}
}
}
diff --git a/tests/Symfony/Tests/Component/Security/Authorization/Voter/RoleHierarchyVoterTest.php b/tests/Symfony/Tests/Component/Security/Core/Authorization/Voter/RoleHierarchyVoterTest.php
similarity index 76%
rename from tests/Symfony/Tests/Component/Security/Authorization/Voter/RoleHierarchyVoterTest.php
rename to tests/Symfony/Tests/Component/Security/Core/Authorization/Voter/RoleHierarchyVoterTest.php
index 550a09e081..e456cb19f4 100644
--- a/tests/Symfony/Tests/Component/Security/Authorization/Voter/RoleHierarchyVoterTest.php
+++ b/tests/Symfony/Tests/Component/Security/Core/Authorization/Voter/RoleHierarchyVoterTest.php
@@ -9,11 +9,11 @@
* file that was distributed with this source code.
*/
-namespace Symfony\Tests\Component\Security\Authorization\Voter;
+namespace Symfony\Tests\Component\Security\Core\Authorization\Voter;
-use Symfony\Component\Security\Authorization\Voter\RoleHierarchyVoter;
-use Symfony\Component\Security\Authorization\Voter\VoterInterface;
-use Symfony\Component\Security\Role\RoleHierarchy;
+use Symfony\Component\Security\Core\Authorization\Voter\RoleHierarchyVoter;
+use Symfony\Component\Security\Core\Authorization\Voter\VoterInterface;
+use Symfony\Component\Security\Core\Role\RoleHierarchy;
require_once __DIR__.'/RoleVoterTest.php';
diff --git a/tests/Symfony/Tests/Component/Security/Authorization/Voter/RoleVoterTest.php b/tests/Symfony/Tests/Component/Security/Core/Authorization/Voter/RoleVoterTest.php
similarity index 81%
rename from tests/Symfony/Tests/Component/Security/Authorization/Voter/RoleVoterTest.php
rename to tests/Symfony/Tests/Component/Security/Core/Authorization/Voter/RoleVoterTest.php
index 4b3c7e6451..16717176ce 100644
--- a/tests/Symfony/Tests/Component/Security/Authorization/Voter/RoleVoterTest.php
+++ b/tests/Symfony/Tests/Component/Security/Core/Authorization/Voter/RoleVoterTest.php
@@ -9,11 +9,11 @@
* file that was distributed with this source code.
*/
-namespace Symfony\Tests\Component\Security\Authorization\Voter;
+namespace Symfony\Tests\Component\Security\Core\Authorization\Voter;
-use Symfony\Component\Security\Authorization\Voter\RoleVoter;
-use Symfony\Component\Security\Authorization\Voter\VoterInterface;
-use Symfony\Component\Security\Role\Role;
+use Symfony\Component\Security\Core\Authorization\Voter\RoleVoter;
+use Symfony\Component\Security\Core\Authorization\Voter\VoterInterface;
+use Symfony\Component\Security\Core\Role\Role;
class RoleVoterTest extends \PHPUnit_Framework_TestCase
{
@@ -51,7 +51,7 @@ class RoleVoterTest extends \PHPUnit_Framework_TestCase
foreach ($roles as $i => $role) {
$roles[$i] = new Role($role);
}
- $token = $this->getMock('Symfony\Component\Security\Authentication\Token\TokenInterface');
+ $token = $this->getMock('Symfony\Component\Security\Core\Authentication\Token\TokenInterface');
$token->expects($this->once())
->method('getRoles')
->will($this->returnValue($roles));
diff --git a/tests/Symfony/Tests/Component/Security/Encoder/BasePasswordEncoderTest.php b/tests/Symfony/Tests/Component/Security/Core/Encoder/BasePasswordEncoderTest.php
similarity index 95%
rename from tests/Symfony/Tests/Component/Security/Encoder/BasePasswordEncoderTest.php
rename to tests/Symfony/Tests/Component/Security/Core/Encoder/BasePasswordEncoderTest.php
index d9f65bd2cb..3ca1921b10 100644
--- a/tests/Symfony/Tests/Component/Security/Encoder/BasePasswordEncoderTest.php
+++ b/tests/Symfony/Tests/Component/Security/Core/Encoder/BasePasswordEncoderTest.php
@@ -9,9 +9,9 @@
* file that was distributed with this source code.
*/
-namespace Symfony\Tests\Component\Security\Encoder;
+namespace Symfony\Tests\Component\Security\Core\Encoder;
-use Symfony\Component\Security\Encoder\BasePasswordEncoder;
+use Symfony\Component\Security\Core\Encoder\BasePasswordEncoder;
class PasswordEncoder extends BasePasswordEncoder
{
diff --git a/tests/Symfony/Tests/Component/Security/Encoder/EncoderFactoryTest.php b/tests/Symfony/Tests/Component/Security/Core/Encoder/EncoderFactoryTest.php
similarity index 67%
rename from tests/Symfony/Tests/Component/Security/Encoder/EncoderFactoryTest.php
rename to tests/Symfony/Tests/Component/Security/Core/Encoder/EncoderFactoryTest.php
index 38866e3749..189443df08 100644
--- a/tests/Symfony/Tests/Component/Security/Encoder/EncoderFactoryTest.php
+++ b/tests/Symfony/Tests/Component/Security/Core/Encoder/EncoderFactoryTest.php
@@ -9,21 +9,21 @@
* file that was distributed with this source code.
*/
-namespace Symfony\Tests\Component\Security\Encoder;
+namespace Symfony\Tests\Component\Security\Core\Encoder;
-use Symfony\Component\Security\Encoder\MessageDigestPasswordEncoder;
-use Symfony\Component\Security\Encoder\EncoderFactory;
+use Symfony\Component\Security\Core\Encoder\MessageDigestPasswordEncoder;
+use Symfony\Component\Security\Core\Encoder\EncoderFactory;
class EncoderFactoryTest extends \PHPUnit_Framework_TestCase
{
public function testGetEncoderWithMessageDigestEncoder()
{
- $factory = new EncoderFactory(array('Symfony\Component\Security\User\AccountInterface' => array(
- 'class' => 'Symfony\Component\Security\Encoder\MessageDigestPasswordEncoder',
+ $factory = new EncoderFactory(array('Symfony\Component\Security\Core\User\AccountInterface' => array(
+ 'class' => 'Symfony\Component\Security\Core\Encoder\MessageDigestPasswordEncoder',
'arguments' => array('sha512', true, 5),
)));
- $encoder = $factory->getEncoder($this->getMock('Symfony\Component\Security\User\AccountInterface'));
+ $encoder = $factory->getEncoder($this->getMock('Symfony\Component\Security\Core\User\AccountInterface'));
$expectedEncoder = new MessageDigestPasswordEncoder('sha512', true, 5);
$this->assertEquals($expectedEncoder->encodePassword('foo', 'moo'), $encoder->encodePassword('foo', 'moo'));
@@ -32,9 +32,9 @@ class EncoderFactoryTest extends \PHPUnit_Framework_TestCase
public function testGetEncoderWithService()
{
$factory = new EncoderFactory(array());
- $factory->addEncoder('Symfony\Component\Security\User\AccountInterface', new MessageDigestPasswordEncoder('sha1'));
+ $factory->addEncoder('Symfony\Component\Security\Core\User\AccountInterface', new MessageDigestPasswordEncoder('sha1'));
- $encoder = $factory->getEncoder($this->getMock('Symfony\Component\Security\User\AccountInterface'));
+ $encoder = $factory->getEncoder($this->getMock('Symfony\Component\Security\Core\User\AccountInterface'));
$expectedEncoder = new MessageDigestPasswordEncoder('sha1');
$this->assertEquals($expectedEncoder->encodePassword('foo', ''), $encoder->encodePassword('foo', ''));
diff --git a/tests/Symfony/Tests/Component/Security/Encoder/MessageDigestPasswordEncoderTest.php b/tests/Symfony/Tests/Component/Security/Core/Encoder/MessageDigestPasswordEncoderTest.php
similarity index 91%
rename from tests/Symfony/Tests/Component/Security/Encoder/MessageDigestPasswordEncoderTest.php
rename to tests/Symfony/Tests/Component/Security/Core/Encoder/MessageDigestPasswordEncoderTest.php
index 186aa00147..4c595d49d9 100644
--- a/tests/Symfony/Tests/Component/Security/Encoder/MessageDigestPasswordEncoderTest.php
+++ b/tests/Symfony/Tests/Component/Security/Core/Encoder/MessageDigestPasswordEncoderTest.php
@@ -9,9 +9,9 @@
* file that was distributed with this source code.
*/
-namespace Symfony\Tests\Component\Security\Encoder;
+namespace Symfony\Tests\Component\Security\Core\Encoder;
-use Symfony\Component\Security\Encoder\MessageDigestPasswordEncoder;
+use Symfony\Component\Security\Core\Encoder\MessageDigestPasswordEncoder;
class MessageDigestPasswordEncoderTest extends \PHPUnit_Framework_TestCase
{
diff --git a/tests/Symfony/Tests/Component/Security/Encoder/PlaintextPasswordEncoderTest.php b/tests/Symfony/Tests/Component/Security/Core/Encoder/PlaintextPasswordEncoderTest.php
similarity index 90%
rename from tests/Symfony/Tests/Component/Security/Encoder/PlaintextPasswordEncoderTest.php
rename to tests/Symfony/Tests/Component/Security/Core/Encoder/PlaintextPasswordEncoderTest.php
index 37c342222c..e06d737784 100644
--- a/tests/Symfony/Tests/Component/Security/Encoder/PlaintextPasswordEncoderTest.php
+++ b/tests/Symfony/Tests/Component/Security/Core/Encoder/PlaintextPasswordEncoderTest.php
@@ -9,9 +9,9 @@
* file that was distributed with this source code.
*/
-namespace Symfony\Tests\Component\Security\Encoder;
+namespace Symfony\Tests\Component\Security\Core\Encoder;
-use Symfony\Component\Security\Encoder\PlaintextPasswordEncoder;
+use Symfony\Component\Security\Core\Encoder\PlaintextPasswordEncoder;
class PlaintextPasswordEncoderTest extends \PHPUnit_Framework_TestCase
{
diff --git a/tests/Symfony/Tests/Component/Security/Role/RoleHierarchyTest.php b/tests/Symfony/Tests/Component/Security/Core/Role/RoleHierarchyTest.php
similarity index 89%
rename from tests/Symfony/Tests/Component/Security/Role/RoleHierarchyTest.php
rename to tests/Symfony/Tests/Component/Security/Core/Role/RoleHierarchyTest.php
index bb2ebf97ba..3ca426803a 100644
--- a/tests/Symfony/Tests/Component/Security/Role/RoleHierarchyTest.php
+++ b/tests/Symfony/Tests/Component/Security/Core/Role/RoleHierarchyTest.php
@@ -9,10 +9,10 @@
* file that was distributed with this source code.
*/
-namespace Symfony\Tests\Component\Security\Role;
+namespace Symfony\Tests\Component\Security\Core\Role;
-use Symfony\Component\Security\Role\RoleHierarchy;
-use Symfony\Component\Security\Role\Role;
+use Symfony\Component\Security\Core\Role\RoleHierarchy;
+use Symfony\Component\Security\Core\Role\Role;
class RoleHierarchyTest extends \PHPUnit_Framework_TestCase
{
diff --git a/tests/Symfony/Tests/Component/Security/Role/RoleTest.php b/tests/Symfony/Tests/Component/Security/Core/Role/RoleTest.php
similarity index 81%
rename from tests/Symfony/Tests/Component/Security/Role/RoleTest.php
rename to tests/Symfony/Tests/Component/Security/Core/Role/RoleTest.php
index 6f68bb9f86..a07d90e7d8 100644
--- a/tests/Symfony/Tests/Component/Security/Role/RoleTest.php
+++ b/tests/Symfony/Tests/Component/Security/Core/Role/RoleTest.php
@@ -9,9 +9,9 @@
* file that was distributed with this source code.
*/
-namespace Symfony\Tests\Component\Security\Role;
+namespace Symfony\Tests\Component\Security\Core\Role;
-use Symfony\Component\Security\Role\Role;
+use Symfony\Component\Security\Core\Role\Role;
class RoleTest extends \PHPUnit_Framework_TestCase
{
diff --git a/tests/Symfony/Tests/Component/Security/Role/SwitchUserRoleTest.php b/tests/Symfony/Tests/Component/Security/Core/Role/SwitchUserRoleTest.php
similarity index 72%
rename from tests/Symfony/Tests/Component/Security/Role/SwitchUserRoleTest.php
rename to tests/Symfony/Tests/Component/Security/Core/Role/SwitchUserRoleTest.php
index 608c571df8..d4ba1430dd 100644
--- a/tests/Symfony/Tests/Component/Security/Role/SwitchUserRoleTest.php
+++ b/tests/Symfony/Tests/Component/Security/Core/Role/SwitchUserRoleTest.php
@@ -9,22 +9,22 @@
* file that was distributed with this source code.
*/
-namespace Symfony\Tests\Component\Security\Role;
+namespace Symfony\Tests\Component\Security\Core\Role;
-use Symfony\Component\Security\Role\SwitchUserRole;
+use Symfony\Component\Security\Core\Role\SwitchUserRole;
class SwitchUserRoleTest extends \PHPUnit_Framework_TestCase
{
public function testGetSource()
{
- $role = new SwitchUserRole('FOO', $token = $this->getMock('Symfony\Component\Security\Authentication\Token\TokenInterface'));
+ $role = new SwitchUserRole('FOO', $token = $this->getMock('Symfony\Component\Security\Core\Authentication\Token\TokenInterface'));
$this->assertSame($token, $role->getSource());
}
public function testGetRole()
{
- $role = new SwitchUserRole('FOO', $this->getMock('Symfony\Component\Security\Authentication\Token\TokenInterface'));
+ $role = new SwitchUserRole('FOO', $this->getMock('Symfony\Component\Security\Core\Authentication\Token\TokenInterface'));
$this->assertEquals('FOO', $role->getRole());
}
diff --git a/tests/Symfony/Tests/Component/Security/SecurityContextTest.php b/tests/Symfony/Tests/Component/Security/Core/SecurityContextTest.php
similarity index 67%
rename from tests/Symfony/Tests/Component/Security/SecurityContextTest.php
rename to tests/Symfony/Tests/Component/Security/Core/SecurityContextTest.php
index aa5917f3bd..0b79230979 100644
--- a/tests/Symfony/Tests/Component/Security/SecurityContextTest.php
+++ b/tests/Symfony/Tests/Component/Security/Core/SecurityContextTest.php
@@ -9,20 +9,20 @@
* file that was distributed with this source code.
*/
-namespace Symfony\Tests\Component\Security;
+namespace Symfony\Tests\Component\Security\Core;
-use Symfony\Component\Security\Authentication\AuthenticationProviderManager;
-use Symfony\Component\Security\SecurityContext;
+use Symfony\Component\Security\Core\Authentication\AuthenticationProviderManager;
+use Symfony\Component\Security\Core\SecurityContext;
class SecurityContextTest extends \PHPUnit_Framework_TestCase
{
public function testGetUser()
{
- $context = new SecurityContext($this->getMock('Symfony\Component\Security\Authentication\AuthenticationManagerInterface'));
+ $context = new SecurityContext($this->getMock('Symfony\Component\Security\Core\Authentication\AuthenticationManagerInterface'));
$this->assertNull($context->getUser());
- $token = $this->getMock('Symfony\Component\Security\Authentication\Token\TokenInterface');
+ $token = $this->getMock('Symfony\Component\Security\Core\Authentication\Token\TokenInterface');
$token->expects($this->once())->method('getUser')->will($this->returnValue('foo'));
$context->setToken($token);
$this->assertEquals('foo', $context->getUser());
@@ -30,17 +30,17 @@ class SecurityContextTest extends \PHPUnit_Framework_TestCase
public function testVoteAuthenticatesTokenIfNecessary()
{
- $authManager = $this->getMock('Symfony\Component\Security\Authentication\AuthenticationManagerInterface');
- $decisionManager = $this->getMock('Symfony\Component\Security\Authorization\AccessDecisionManagerInterface');
+ $authManager = $this->getMock('Symfony\Component\Security\Core\Authentication\AuthenticationManagerInterface');
+ $decisionManager = $this->getMock('Symfony\Component\Security\Core\Authorization\AccessDecisionManagerInterface');
$context = new SecurityContext($authManager, $decisionManager);
- $context->setToken($token = $this->getMock('Symfony\Component\Security\Authentication\Token\TokenInterface'));
+ $context->setToken($token = $this->getMock('Symfony\Component\Security\Core\Authentication\Token\TokenInterface'));
$authManager
->expects($this->once())
->method('authenticate')
->with($this->equalTo($token))
- ->will($this->returnValue($newToken = $this->getMock('Symfony\Component\Security\Authentication\Token\TokenInterface')))
+ ->will($this->returnValue($newToken = $this->getMock('Symfony\Component\Security\Core\Authentication\Token\TokenInterface')))
;
$decisionManager
@@ -55,15 +55,15 @@ class SecurityContextTest extends \PHPUnit_Framework_TestCase
public function testVote()
{
- $context = new SecurityContext($this->getMock('Symfony\Component\Security\Authentication\AuthenticationManagerInterface'));
+ $context = new SecurityContext($this->getMock('Symfony\Component\Security\Core\Authentication\AuthenticationManagerInterface'));
$this->assertFalse($context->vote('ROLE_FOO'));
- $context->setToken($token = $this->getMock('Symfony\Component\Security\Authentication\Token\TokenInterface'));
+ $context->setToken($token = $this->getMock('Symfony\Component\Security\Core\Authentication\Token\TokenInterface'));
$this->assertFalse($context->vote('ROLE_FOO'));
- $manager = $this->getMock('Symfony\Component\Security\Authorization\AccessDecisionManagerInterface');
+ $manager = $this->getMock('Symfony\Component\Security\Core\Authorization\AccessDecisionManagerInterface');
$manager->expects($this->once())->method('decide')->will($this->returnValue(false));
- $context = new SecurityContext($this->getMock('Symfony\Component\Security\Authentication\AuthenticationManagerInterface'), $manager);
- $context->setToken($token = $this->getMock('Symfony\Component\Security\Authentication\Token\TokenInterface'));
+ $context = new SecurityContext($this->getMock('Symfony\Component\Security\Core\Authentication\AuthenticationManagerInterface'), $manager);
+ $context->setToken($token = $this->getMock('Symfony\Component\Security\Core\Authentication\Token\TokenInterface'));
$token
->expects($this->once())
->method('isAuthenticated')
@@ -71,10 +71,10 @@ class SecurityContextTest extends \PHPUnit_Framework_TestCase
;
$this->assertFalse($context->vote('ROLE_FOO'));
- $manager = $this->getMock('Symfony\Component\Security\Authorization\AccessDecisionManagerInterface');
+ $manager = $this->getMock('Symfony\Component\Security\Core\Authorization\AccessDecisionManagerInterface');
$manager->expects($this->once())->method('decide')->will($this->returnValue(true));
- $context = new SecurityContext($this->getMock('Symfony\Component\Security\Authentication\AuthenticationManagerInterface'), $manager);
- $context->setToken($token = $this->getMock('Symfony\Component\Security\Authentication\Token\TokenInterface'));
+ $context = new SecurityContext($this->getMock('Symfony\Component\Security\Core\Authentication\AuthenticationManagerInterface'), $manager);
+ $context->setToken($token = $this->getMock('Symfony\Component\Security\Core\Authentication\Token\TokenInterface'));
$token
->expects($this->once())
->method('isAuthenticated')
@@ -85,10 +85,10 @@ class SecurityContextTest extends \PHPUnit_Framework_TestCase
public function testGetSetToken()
{
- $context = new SecurityContext($this->getMock('Symfony\Component\Security\Authentication\AuthenticationManagerInterface'));
+ $context = new SecurityContext($this->getMock('Symfony\Component\Security\Core\Authentication\AuthenticationManagerInterface'));
$this->assertNull($context->getToken());
- $context->setToken($token = $this->getMock('Symfony\Component\Security\Authentication\Token\TokenInterface'));
+ $context->setToken($token = $this->getMock('Symfony\Component\Security\Core\Authentication\Token\TokenInterface'));
$this->assertSame($token, $context->getToken());
}
}
diff --git a/tests/Symfony/Tests/Component/Security/User/AccountCheckerTest.php b/tests/Symfony/Tests/Component/Security/Core/User/AccountCheckerTest.php
similarity index 70%
rename from tests/Symfony/Tests/Component/Security/User/AccountCheckerTest.php
rename to tests/Symfony/Tests/Component/Security/Core/User/AccountCheckerTest.php
index fa573e90d4..ff403b9ed8 100644
--- a/tests/Symfony/Tests/Component/Security/User/AccountCheckerTest.php
+++ b/tests/Symfony/Tests/Component/Security/Core/User/AccountCheckerTest.php
@@ -9,9 +9,9 @@
* file that was distributed with this source code.
*/
-namespace Symfony\Tests\Component\Security\User;
+namespace Symfony\Tests\Component\Security\Core\User;
-use Symfony\Component\Security\User\AccountChecker;
+use Symfony\Component\Security\Core\User\AccountChecker;
class AccountCheckerTest extends \PHPUnit_Framework_TestCase
{
@@ -19,27 +19,27 @@ class AccountCheckerTest extends \PHPUnit_Framework_TestCase
{
$checker = new AccountChecker();
- $this->assertNull($checker->checkPreAuth($this->getMock('Symfony\Component\Security\User\AccountInterface')));
+ $this->assertNull($checker->checkPreAuth($this->getMock('Symfony\Component\Security\Core\User\AccountInterface')));
}
public function testCheckPreAuthPass()
{
$checker = new AccountChecker();
- $account = $this->getMock('Symfony\Component\Security\User\AdvancedAccountInterface');
+ $account = $this->getMock('Symfony\Component\Security\Core\User\AdvancedAccountInterface');
$account->expects($this->once())->method('isCredentialsNonExpired')->will($this->returnValue(true));
$this->assertNull($checker->checkPreAuth($account));
}
/**
- * @expectedException Symfony\Component\Security\Exception\CredentialsExpiredException
+ * @expectedException Symfony\Component\Security\Core\Exception\CredentialsExpiredException
*/
public function testCheckPreAuthCredentialsExpired()
{
$checker = new AccountChecker();
- $account = $this->getMock('Symfony\Component\Security\User\AdvancedAccountInterface');
+ $account = $this->getMock('Symfony\Component\Security\Core\User\AdvancedAccountInterface');
$account->expects($this->once())->method('isCredentialsNonExpired')->will($this->returnValue(false));
$checker->checkPreAuth($account);
@@ -49,14 +49,14 @@ class AccountCheckerTest extends \PHPUnit_Framework_TestCase
{
$checker = new AccountChecker();
- $this->assertNull($checker->checkPostAuth($this->getMock('Symfony\Component\Security\User\AccountInterface')));
+ $this->assertNull($checker->checkPostAuth($this->getMock('Symfony\Component\Security\Core\User\AccountInterface')));
}
public function testCheckPostAuthPass()
{
$checker = new AccountChecker();
- $account = $this->getMock('Symfony\Component\Security\User\AdvancedAccountInterface');
+ $account = $this->getMock('Symfony\Component\Security\Core\User\AdvancedAccountInterface');
$account->expects($this->once())->method('isAccountNonLocked')->will($this->returnValue(true));
$account->expects($this->once())->method('isEnabled')->will($this->returnValue(true));
$account->expects($this->once())->method('isAccountNonExpired')->will($this->returnValue(true));
@@ -65,26 +65,26 @@ class AccountCheckerTest extends \PHPUnit_Framework_TestCase
}
/**
- * @expectedException Symfony\Component\Security\Exception\LockedException
+ * @expectedException Symfony\Component\Security\Core\Exception\LockedException
*/
public function testCheckPostAuthAccountLocked()
{
$checker = new AccountChecker();
- $account = $this->getMock('Symfony\Component\Security\User\AdvancedAccountInterface');
+ $account = $this->getMock('Symfony\Component\Security\Core\User\AdvancedAccountInterface');
$account->expects($this->once())->method('isAccountNonLocked')->will($this->returnValue(false));
$checker->checkPostAuth($account);
}
/**
- * @expectedException Symfony\Component\Security\Exception\DisabledException
+ * @expectedException Symfony\Component\Security\Core\Exception\DisabledException
*/
public function testCheckPostAuthDisabled()
{
$checker = new AccountChecker();
- $account = $this->getMock('Symfony\Component\Security\User\AdvancedAccountInterface');
+ $account = $this->getMock('Symfony\Component\Security\Core\User\AdvancedAccountInterface');
$account->expects($this->once())->method('isAccountNonLocked')->will($this->returnValue(true));
$account->expects($this->once())->method('isEnabled')->will($this->returnValue(false));
@@ -92,13 +92,13 @@ class AccountCheckerTest extends \PHPUnit_Framework_TestCase
}
/**
- * @expectedException Symfony\Component\Security\Exception\AccountExpiredException
+ * @expectedException Symfony\Component\Security\Core\Exception\AccountExpiredException
*/
public function testCheckPostAuthAccountExpired()
{
$checker = new AccountChecker();
- $account = $this->getMock('Symfony\Component\Security\User\AdvancedAccountInterface');
+ $account = $this->getMock('Symfony\Component\Security\Core\User\AdvancedAccountInterface');
$account->expects($this->once())->method('isAccountNonLocked')->will($this->returnValue(true));
$account->expects($this->once())->method('isEnabled')->will($this->returnValue(true));
$account->expects($this->once())->method('isAccountNonExpired')->will($this->returnValue(false));
diff --git a/tests/Symfony/Tests/Component/Security/User/InMemoryProviderTest.php b/tests/Symfony/Tests/Component/Security/Core/User/InMemoryProviderTest.php
similarity index 85%
rename from tests/Symfony/Tests/Component/Security/User/InMemoryProviderTest.php
rename to tests/Symfony/Tests/Component/Security/Core/User/InMemoryProviderTest.php
index b9ed5ad9a5..8ffbed4b03 100644
--- a/tests/Symfony/Tests/Component/Security/User/InMemoryProviderTest.php
+++ b/tests/Symfony/Tests/Component/Security/Core/User/InMemoryProviderTest.php
@@ -9,10 +9,10 @@
* file that was distributed with this source code.
*/
-namespace Symfony\Tests\Component\Security\User;
+namespace Symfony\Tests\Component\Security\Core\User;
-use Symfony\Component\Security\User\InMemoryUserProvider;
-use Symfony\Component\Security\User\User;
+use Symfony\Component\Security\Core\User\InMemoryUserProvider;
+use Symfony\Component\Security\Core\User\User;
class InMemoryUserProviderTest extends \PHPUnit_Framework_TestCase
{
@@ -52,7 +52,7 @@ class InMemoryUserProviderTest extends \PHPUnit_Framework_TestCase
}
/**
- * @expectedException Symfony\Component\Security\Exception\UsernameNotFoundException
+ * @expectedException Symfony\Component\Security\Core\Exception\UsernameNotFoundException
*/
public function testLoadUserByUsernameDoesNotExist()
{
diff --git a/tests/Symfony/Tests/Component/Security/User/UserTest.php b/tests/Symfony/Tests/Component/Security/Core/User/UserTest.php
similarity index 72%
rename from tests/Symfony/Tests/Component/Security/User/UserTest.php
rename to tests/Symfony/Tests/Component/Security/Core/User/UserTest.php
index 954dec5b6c..146bca7737 100644
--- a/tests/Symfony/Tests/Component/Security/User/UserTest.php
+++ b/tests/Symfony/Tests/Component/Security/Core/User/UserTest.php
@@ -9,14 +9,14 @@
* file that was distributed with this source code.
*/
-namespace Symfony\Tests\Component\Security\User;
+namespace Symfony\Tests\Component\Security\Core\User;
-use Symfony\Component\Security\User\User;
+use Symfony\Component\Security\Core\User\User;
class UserTest extends \PHPUnit_Framework_TestCase
{
/**
- * @covers Symfony\Component\Security\User\User::__construct
+ * @covers Symfony\Component\Security\Core\User\User::__construct
* @expectedException InvalidArgumentException
*/
public function testConstructorException()
@@ -25,8 +25,8 @@ class UserTest extends \PHPUnit_Framework_TestCase
}
/**
- * @covers Symfony\Component\Security\User\User::__construct
- * @covers Symfony\Component\Security\User\User::getRoles
+ * @covers Symfony\Component\Security\Core\User\User::__construct
+ * @covers Symfony\Component\Security\Core\User\User::getRoles
*/
public function testGetRoles()
{
@@ -38,8 +38,8 @@ class UserTest extends \PHPUnit_Framework_TestCase
}
/**
- * @covers Symfony\Component\Security\User\User::__construct
- * @covers Symfony\Component\Security\User\User::getPassword
+ * @covers Symfony\Component\Security\Core\User\User::__construct
+ * @covers Symfony\Component\Security\Core\User\User::getPassword
*/
public function testGetPassword()
{
@@ -48,8 +48,8 @@ class UserTest extends \PHPUnit_Framework_TestCase
}
/**
- * @covers Symfony\Component\Security\User\User::__construct
- * @covers Symfony\Component\Security\User\User::getUsername
+ * @covers Symfony\Component\Security\Core\User\User::__construct
+ * @covers Symfony\Component\Security\Core\User\User::getUsername
*/
public function testGetUsername()
{
@@ -58,7 +58,7 @@ class UserTest extends \PHPUnit_Framework_TestCase
}
/**
- * @covers Symfony\Component\Security\User\User::getSalt
+ * @covers Symfony\Component\Security\Core\User\User::getSalt
*/
public function testGetSalt()
{
@@ -67,7 +67,7 @@ class UserTest extends \PHPUnit_Framework_TestCase
}
/**
- * @covers Symfony\Component\Security\User\User::isAccountNonExpired
+ * @covers Symfony\Component\Security\Core\User\User::isAccountNonExpired
*/
public function testIsAccountNonExpired()
{
@@ -79,7 +79,7 @@ class UserTest extends \PHPUnit_Framework_TestCase
}
/**
- * @covers Symfony\Component\Security\User\User::isCredentialsNonExpired
+ * @covers Symfony\Component\Security\Core\User\User::isCredentialsNonExpired
*/
public function testIsCredentialsNonExpired()
{
@@ -91,7 +91,7 @@ class UserTest extends \PHPUnit_Framework_TestCase
}
/**
- * @covers Symfony\Component\Security\User\User::isAccountNonLocked
+ * @covers Symfony\Component\Security\Core\User\User::isAccountNonLocked
*/
public function testIsAccountNonLocked()
{
@@ -103,7 +103,7 @@ class UserTest extends \PHPUnit_Framework_TestCase
}
/**
- * @covers Symfony\Component\Security\User\User::isEnabled
+ * @covers Symfony\Component\Security\Core\User\User::isEnabled
*/
public function testIsEnabled()
{
@@ -115,7 +115,7 @@ class UserTest extends \PHPUnit_Framework_TestCase
}
/**
- * @covers Symfony\Component\Security\User\User::eraseCredentials
+ * @covers Symfony\Component\Security\Core\User\User::eraseCredentials
*/
public function testEraseCredentials()
{
@@ -125,7 +125,7 @@ class UserTest extends \PHPUnit_Framework_TestCase
}
/**
- * @covers Symfony\Component\Security\User\User::__toString
+ * @covers Symfony\Component\Security\Core\User\User::__toString
*/
public function testMagicToString()
{
diff --git a/src/Symfony/Bundle/SecurityBundle/Tests/Security/Firewall/RememberMeListenerTest.php b/tests/Symfony/Tests/Component/Security/Http/Firewall/RememberMeListenerTest.php
similarity index 92%
rename from src/Symfony/Bundle/SecurityBundle/Tests/Security/Firewall/RememberMeListenerTest.php
rename to tests/Symfony/Tests/Component/Security/Http/Firewall/RememberMeListenerTest.php
index 25d3611f1f..87c965c1c7 100644
--- a/src/Symfony/Bundle/SecurityBundle/Tests/Security/Firewall/RememberMeListenerTest.php
+++ b/tests/Symfony/Tests/Component/Security/Http/Firewall/RememberMeListenerTest.php
@@ -1,12 +1,12 @@
expects($this->once())
->method('getToken')
- ->will($this->returnValue($this->getMock('Symfony\Component\Security\Authentication\Token\TokenInterface')))
+ ->will($this->returnValue($this->getMock('Symfony\Component\Security\Core\Authentication\Token\TokenInterface')))
;
$context
@@ -159,7 +159,7 @@ class RememberMeListenerTest extends \PHPUnit_Framework_TestCase
$service
->expects($this->once())
->method('autoLogin')
- ->will($this->returnValue($this->getMock('Symfony\Component\Security\Authentication\Token\TokenInterface')))
+ ->will($this->returnValue($this->getMock('Symfony\Component\Security\Core\Authentication\Token\TokenInterface')))
;
$event = $this->getEvent();
@@ -188,7 +188,7 @@ class RememberMeListenerTest extends \PHPUnit_Framework_TestCase
$service
->expects($this->once())
->method('autoLogin')
- ->will($this->returnValue($this->getMock('Symfony\Component\Security\Authentication\Token\TokenInterface')))
+ ->will($this->returnValue($this->getMock('Symfony\Component\Security\Core\Authentication\Token\TokenInterface')))
;
$exception = new AuthenticationException('Authentication failed.');
@@ -221,7 +221,7 @@ class RememberMeListenerTest extends \PHPUnit_Framework_TestCase
->will($this->returnValue(null))
;
- $token = $this->getMock('Symfony\Component\Security\Authentication\Token\TokenInterface');
+ $token = $this->getMock('Symfony\Component\Security\Core\Authentication\Token\TokenInterface');
$service
->expects($this->once())
->method('autoLogin')
@@ -277,7 +277,7 @@ class RememberMeListenerTest extends \PHPUnit_Framework_TestCase
$request = new Request();
$response = new Response();
- $token = $this->getMock('Symfony\Component\Security\Authentication\Token\TokenInterface');
+ $token = $this->getMock('Symfony\Component\Security\Core\Authentication\Token\TokenInterface');
$this->setLastState($listener, $token);
$event = $this->getEvent();
@@ -379,17 +379,17 @@ class RememberMeListenerTest extends \PHPUnit_Framework_TestCase
protected function getManager()
{
- return $this->getMock('Symfony\Component\Security\Authentication\AuthenticationManagerInterface');
+ return $this->getMock('Symfony\Component\Security\Core\Authentication\AuthenticationManagerInterface');
}
protected function getService()
{
- return $this->getMock('Symfony\Bundle\SecurityBundle\Security\RememberMe\RememberMeServicesInterface');
+ return $this->getMock('Symfony\Component\Security\Http\RememberMe\RememberMeServicesInterface');
}
protected function getContext()
{
- return $this->getMockBuilder('Symfony\Component\Security\SecurityContext')
+ return $this->getMockBuilder('Symfony\Component\Security\Core\SecurityContext')
->disableOriginalConstructor()
->getMock();
}
diff --git a/src/Symfony/Bundle/SecurityBundle/Tests/Security/Logout/CookieClearingLogoutHandlerTest.php b/tests/Symfony/Tests/Component/Security/Http/Logout/CookieClearingLogoutHandlerTest.php
similarity index 85%
rename from src/Symfony/Bundle/SecurityBundle/Tests/Security/Logout/CookieClearingLogoutHandlerTest.php
rename to tests/Symfony/Tests/Component/Security/Http/Logout/CookieClearingLogoutHandlerTest.php
index f9e8a66af8..e680725372 100644
--- a/src/Symfony/Bundle/SecurityBundle/Tests/Security/Logout/CookieClearingLogoutHandlerTest.php
+++ b/tests/Symfony/Tests/Component/Security/Http/Logout/CookieClearingLogoutHandlerTest.php
@@ -9,11 +9,11 @@
* file that was distributed with this source code.
*/
-namespace Symfony\Bundle\SecurityBundle\Tests\Security\Logout;
+namespace Symfony\Tests\Component\Security\Http\Logout;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpFoundation\Request;
-use Symfony\Bundle\SecurityBundle\Security\Logout\CookieClearingLogoutHandler;
+use Symfony\Component\Security\Http\Logout\CookieClearingLogoutHandler;
class CookieClearingLogoutHandlerTest extends \PHPUnit_Framework_TestCase
{
@@ -30,7 +30,7 @@ class CookieClearingLogoutHandlerTest extends \PHPUnit_Framework_TestCase
{
$request = new Request();
$response = new Response();
- $token = $this->getMock('Symfony\Component\Security\Authentication\Token\TokenInterface');
+ $token = $this->getMock('Symfony\Component\Security\Core\Authentication\Token\TokenInterface');
$handler = new CookieClearingLogoutHandler(array('foo', 'foo2'));
diff --git a/src/Symfony/Bundle/SecurityBundle/Tests/Security/Logout/SessionLogoutHandlerTest.php b/tests/Symfony/Tests/Component/Security/Http/Logout/SessionLogoutHandlerTest.php
similarity index 83%
rename from src/Symfony/Bundle/SecurityBundle/Tests/Security/Logout/SessionLogoutHandlerTest.php
rename to tests/Symfony/Tests/Component/Security/Http/Logout/SessionLogoutHandlerTest.php
index f9391dca25..35488ab777 100644
--- a/src/Symfony/Bundle/SecurityBundle/Tests/Security/Logout/SessionLogoutHandlerTest.php
+++ b/tests/Symfony/Tests/Component/Security/Http/Logout/SessionLogoutHandlerTest.php
@@ -9,10 +9,10 @@
* file that was distributed with this source code.
*/
-namespace Symfony\Bundle\SecurityBundle\Tests\Security\Logout;
+namespace Symfony\Tests\Component\Security\Http\Logout;
use Symfony\Component\HttpFoundation\Response;
-use Symfony\Bundle\SecurityBundle\Security\Logout\SessionLogoutHandler;
+use Symfony\Component\Security\Http\Logout\SessionLogoutHandler;
class SessionLogoutHandlerTest extends \PHPUnit_Framework_TestCase
{
@@ -35,6 +35,6 @@ class SessionLogoutHandlerTest extends \PHPUnit_Framework_TestCase
->method('invalidate')
;
- $handler->logout($request, $response, $this->getMock('Symfony\Component\Security\Authentication\Token\TokenInterface'));
+ $handler->logout($request, $response, $this->getMock('Symfony\Component\Security\Core\Authentication\Token\TokenInterface'));
}
}
\ No newline at end of file
diff --git a/src/Symfony/Bundle/SecurityBundle/Tests/Security/RememberMe/PersistentTokenBasedRememberMeServicesTest.php b/tests/Symfony/Tests/Component/Security/Http/RememberMe/PersistentTokenBasedRememberMeServicesTest.php
similarity index 82%
rename from src/Symfony/Bundle/SecurityBundle/Tests/Security/RememberMe/PersistentTokenBasedRememberMeServicesTest.php
rename to tests/Symfony/Tests/Component/Security/Http/RememberMe/PersistentTokenBasedRememberMeServicesTest.php
index 1f2de2f79f..9fca45cd30 100644
--- a/src/Symfony/Bundle/SecurityBundle/Tests/Security/RememberMe/PersistentTokenBasedRememberMeServicesTest.php
+++ b/tests/Symfony/Tests/Component/Security/Http/RememberMe/PersistentTokenBasedRememberMeServicesTest.php
@@ -1,16 +1,16 @@
getMock('Symfony\Component\Security\Authentication\RememberMe\TokenProviderInterface');
+ $tokenProvider = $this->getMock('Symfony\Component\Security\Core\Authentication\RememberMe\TokenProviderInterface');
$tokenProvider
->expects($this->once())
->method('loadTokenBySeries')
@@ -60,7 +60,7 @@ class PersistentTokenBasedRememberMeServicesTest extends \PHPUnit_Framework_Test
}
/**
- * @expectedException Symfony\Component\Security\Exception\UsernameNotFoundException
+ * @expectedException Symfony\Component\Security\Core\Exception\UsernameNotFoundException
*/
public function testAutoLoginThrowsExceptionOnNonExistentUser()
{
@@ -69,7 +69,7 @@ class PersistentTokenBasedRememberMeServicesTest extends \PHPUnit_Framework_Test
$request = new Request;
$request->cookies->set('foo', $this->encodeCookie(array('fooseries', 'foovalue')));
- $tokenProvider = $this->getMock('Symfony\Component\Security\Authentication\RememberMe\TokenProviderInterface');
+ $tokenProvider = $this->getMock('Symfony\Component\Security\Core\Authentication\RememberMe\TokenProviderInterface');
$tokenProvider
->expects($this->once())
->method('loadTokenBySeries')
@@ -93,7 +93,7 @@ class PersistentTokenBasedRememberMeServicesTest extends \PHPUnit_Framework_Test
$request = new Request;
$request->cookies->set('foo', $this->encodeCookie(array('fooseries', 'foovalue')));
- $tokenProvider = $this->getMock('Symfony\Component\Security\Authentication\RememberMe\TokenProviderInterface');
+ $tokenProvider = $this->getMock('Symfony\Component\Security\Core\Authentication\RememberMe\TokenProviderInterface');
$service->setTokenProvider($tokenProvider);
$tokenProvider
@@ -119,7 +119,7 @@ class PersistentTokenBasedRememberMeServicesTest extends \PHPUnit_Framework_Test
}
/**
- * @expectedException Symfony\Component\Security\Exception\AuthenticationException
+ * @expectedException Symfony\Component\Security\Core\Exception\AuthenticationException
* @expectedMessage The cookie has expired.
*/
public function testAutoLoginDoesNotAcceptAnExpiredCookie()
@@ -128,7 +128,7 @@ class PersistentTokenBasedRememberMeServicesTest extends \PHPUnit_Framework_Test
$request = new Request;
$request->cookies->set('foo', $this->encodeCookie(array('fooseries', 'foovalue')));
- $tokenProvider = $this->getMock('Symfony\Component\Security\Authentication\RememberMe\TokenProviderInterface');
+ $tokenProvider = $this->getMock('Symfony\Component\Security\Core\Authentication\RememberMe\TokenProviderInterface');
$tokenProvider
->expects($this->once())
->method('loadTokenBySeries')
@@ -142,7 +142,7 @@ class PersistentTokenBasedRememberMeServicesTest extends \PHPUnit_Framework_Test
public function testAutoLogin()
{
- $user = $this->getMock('Symfony\Component\Security\User\AccountInterface');
+ $user = $this->getMock('Symfony\Component\Security\Core\User\AccountInterface');
$user
->expects($this->once())
->method('getRoles')
@@ -161,7 +161,7 @@ class PersistentTokenBasedRememberMeServicesTest extends \PHPUnit_Framework_Test
$request = new Request;
$request->cookies->set('foo', $this->encodeCookie(array('fooseries', 'foovalue')));
- $tokenProvider = $this->getMock('Symfony\Component\Security\Authentication\RememberMe\TokenProviderInterface');
+ $tokenProvider = $this->getMock('Symfony\Component\Security\Core\Authentication\RememberMe\TokenProviderInterface');
$tokenProvider
->expects($this->once())
->method('loadTokenBySeries')
@@ -172,8 +172,8 @@ class PersistentTokenBasedRememberMeServicesTest extends \PHPUnit_Framework_Test
$returnedToken = $service->autoLogin($request);
- $this->assertInstanceOf('Symfony\Component\Security\Authentication\Token\RememberMeToken', $returnedToken);
- $this->assertInstanceOf('Symfony\Component\Security\Authentication\RememberMe\PersistentTokenInterface', $returnedToken->getPersistentToken());
+ $this->assertInstanceOf('Symfony\Component\Security\Core\Authentication\Token\RememberMeToken', $returnedToken);
+ $this->assertInstanceOf('Symfony\Component\Security\Core\Authentication\RememberMe\PersistentTokenInterface', $returnedToken->getPersistentToken());
$this->assertSame($user, $returnedToken->getUser());
$this->assertEquals('fookey', $returnedToken->getKey());
}
@@ -184,9 +184,9 @@ class PersistentTokenBasedRememberMeServicesTest extends \PHPUnit_Framework_Test
$request = new Request();
$request->cookies->set('foo', $this->encodeCookie(array('fooseries', 'foovalue')));
$response = new Response();
- $token = $this->getMock('Symfony\Component\Security\Authentication\Token\TokenInterface');
+ $token = $this->getMock('Symfony\Component\Security\Core\Authentication\Token\TokenInterface');
- $tokenProvider = $this->getMock('Symfony\Component\Security\Authentication\RememberMe\TokenProviderInterface');
+ $tokenProvider = $this->getMock('Symfony\Component\Security\Core\Authentication\RememberMe\TokenProviderInterface');
$tokenProvider
->expects($this->once())
->method('deleteTokenBySeries')
@@ -210,9 +210,9 @@ class PersistentTokenBasedRememberMeServicesTest extends \PHPUnit_Framework_Test
$service = $this->getService(null, array('name' => 'foo', 'path' => null, 'domain' => null));
$request = new Request;
$response = new Response;
- $token = $this->getMock('Symfony\Component\Security\Authentication\Token\TokenInterface');
+ $token = $this->getMock('Symfony\Component\Security\Core\Authentication\Token\TokenInterface');
- $tokenProvider = $this->getMock('Symfony\Component\Security\Authentication\RememberMe\TokenProviderInterface');
+ $tokenProvider = $this->getMock('Symfony\Component\Security\Core\Authentication\RememberMe\TokenProviderInterface');
$tokenProvider
->expects($this->never())
->method('deleteTokenBySeries')
@@ -234,9 +234,9 @@ class PersistentTokenBasedRememberMeServicesTest extends \PHPUnit_Framework_Test
$request = new Request;
$request->cookies->set('foo', 'somefoovalue');
$response = new Response;
- $token = $this->getMock('Symfony\Component\Security\Authentication\Token\TokenInterface');
+ $token = $this->getMock('Symfony\Component\Security\Core\Authentication\Token\TokenInterface');
- $tokenProvider = $this->getMock('Symfony\Component\Security\Authentication\RememberMe\TokenProviderInterface');
+ $tokenProvider = $this->getMock('Symfony\Component\Security\Core\Authentication\RememberMe\TokenProviderInterface');
$tokenProvider
->expects($this->never())
->method('deleteTokenBySeries')
@@ -269,21 +269,21 @@ class PersistentTokenBasedRememberMeServicesTest extends \PHPUnit_Framework_Test
$request = new Request;
$response = new Response;
- $user = $this->getMock('Symfony\Component\Security\User\AccountInterface');
+ $user = $this->getMock('Symfony\Component\Security\Core\User\AccountInterface');
$user
->expects($this->once())
->method('getRoles')
->will($this->returnValue(array('ROLE_FOO')))
;
- $token = $this->getMock('Symfony\Component\Security\Authentication\Token\RememberMeToken', array(), array($user, 'fookey', 'fookey'));
+ $token = $this->getMock('Symfony\Component\Security\Core\Authentication\Token\RememberMeToken', array(), array($user, 'fookey', 'fookey'));
$token
->expects($this->once())
->method('getPersistentToken')
->will($this->returnValue(new PersistentToken('fooclass', 'foouser', 'fooseries', 'foovalue', new \DateTime())))
;
- $tokenProvider = $this->getMock('Symfony\Component\Security\Authentication\RememberMe\TokenProviderInterface');
+ $tokenProvider = $this->getMock('Symfony\Component\Security\Core\Authentication\RememberMe\TokenProviderInterface');
$tokenProvider
->expects($this->once())
->method('updateToken')
@@ -315,14 +315,14 @@ class PersistentTokenBasedRememberMeServicesTest extends \PHPUnit_Framework_Test
$request = new Request;
$response = new Response;
- $user = $this->getMock('Symfony\Component\Security\User\AccountInterface');
+ $user = $this->getMock('Symfony\Component\Security\Core\User\AccountInterface');
$user
->expects($this->once())
->method('getRoles')
->will($this->returnValue(array('ROLE_FOO')))
;
- $token = $this->getMock('Symfony\Component\Security\Authentication\Token\RememberMeToken', array(), array($user, 'fookey', 'fookey'));
+ $token = $this->getMock('Symfony\Component\Security\Core\Authentication\Token\RememberMeToken', array(), array($user, 'fookey', 'fookey'));
$token
->expects($this->once())
->method('getPersistentToken')
@@ -338,20 +338,20 @@ class PersistentTokenBasedRememberMeServicesTest extends \PHPUnit_Framework_Test
$request = new Request;
$response = new Response;
- $account = $this->getMock('Symfony\Component\Security\User\AccountInterface');
+ $account = $this->getMock('Symfony\Component\Security\Core\User\AccountInterface');
$account
->expects($this->once())
->method('getUsername')
->will($this->returnValue('foo'))
;
- $token = $this->getMock('Symfony\Component\Security\Authentication\Token\TokenInterface');
+ $token = $this->getMock('Symfony\Component\Security\Core\Authentication\Token\TokenInterface');
$token
->expects($this->any())
->method('getUser')
->will($this->returnValue($account))
;
- $tokenProvider = $this->getMock('Symfony\Component\Security\Authentication\RememberMe\TokenProviderInterface');
+ $tokenProvider = $this->getMock('Symfony\Component\Security\Core\Authentication\RememberMe\TokenProviderInterface');
$tokenProvider
->expects($this->once())
->method('createNewToken')
@@ -391,7 +391,7 @@ class PersistentTokenBasedRememberMeServicesTest extends \PHPUnit_Framework_Test
protected function getProvider()
{
- $provider = $this->getMock('Symfony\Component\Security\User\UserProviderInterface');
+ $provider = $this->getMock('Symfony\Component\Security\Core\User\UserProviderInterface');
$provider
->expects($this->any())
->method('supportsClass')
diff --git a/src/Symfony/Bundle/SecurityBundle/Tests/Security/RememberMe/RememberMeServicesTest.php b/tests/Symfony/Tests/Component/Security/Http/RememberMe/RememberMeServicesTest.php
similarity index 82%
rename from src/Symfony/Bundle/SecurityBundle/Tests/Security/RememberMe/RememberMeServicesTest.php
rename to tests/Symfony/Tests/Component/Security/Http/RememberMe/RememberMeServicesTest.php
index 03fd582d9a..c0777908f1 100644
--- a/src/Symfony/Bundle/SecurityBundle/Tests/Security/RememberMe/RememberMeServicesTest.php
+++ b/tests/Symfony/Tests/Component/Security/Http/RememberMe/RememberMeServicesTest.php
@@ -1,6 +1,6 @@
cookies->set('foo', 'foo');
- $token = $this->getMock('Symfony\Component\Security\Authentication\Token\TokenInterface');
+ $token = $this->getMock('Symfony\Component\Security\Core\Authentication\Token\TokenInterface');
$service
->expects($this->once())
@@ -57,7 +57,7 @@ class RememberMeServicesTest extends \PHPUnit_Framework_TestCase
$service = $this->getService(null, array('name' => 'foo', 'path' => null, 'domain' => null));
$request = new Request();
$response = new Response();
- $token = $this->getMock('Symfony\Component\Security\Authentication\Token\TokenInterface');
+ $token = $this->getMock('Symfony\Component\Security\Core\Authentication\Token\TokenInterface');
$this->assertFalse($response->headers->hasCookie('foo'));
@@ -84,8 +84,8 @@ class RememberMeServicesTest extends \PHPUnit_Framework_TestCase
$service = $this->getService(null, array('name' => 'foo', 'always_remember_me' => true));
$request = new Request;
$response = new Response;
- $account = $this->getMock('Symfony\Component\Security\User\AccountInterface');
- $token = $this->getMock('Symfony\Component\Security\Authentication\Token\TokenInterface');
+ $account = $this->getMock('Symfony\Component\Security\Core\User\AccountInterface');
+ $token = $this->getMock('Symfony\Component\Security\Core\Authentication\Token\TokenInterface');
$token
->expects($this->once())
->method('getUser')
@@ -107,8 +107,8 @@ class RememberMeServicesTest extends \PHPUnit_Framework_TestCase
$service = $this->getService(null, array('name' => 'foo', 'always_remember_me' => false, 'remember_me_parameter' => 'foo'));
$request = new Request;
$response = new Response;
- $account = $this->getMock('Symfony\Component\Security\User\AccountInterface');
- $token = $this->getMock('Symfony\Component\Security\Authentication\Token\TokenInterface');
+ $account = $this->getMock('Symfony\Component\Security\Core\User\AccountInterface');
+ $token = $this->getMock('Symfony\Component\Security\Core\Authentication\Token\TokenInterface');
$token
->expects($this->once())
->method('getUser')
@@ -131,8 +131,8 @@ class RememberMeServicesTest extends \PHPUnit_Framework_TestCase
$service = $this->getService(null, array('name' => 'foo', 'always_remember_me' => true));
$request = new Request;
$response = new Response;
- $account = $this->getMock('Symfony\Component\Security\User\AccountInterface');
- $token = $this->getMock('Symfony\Component\Security\Authentication\Token\TokenInterface');
+ $account = $this->getMock('Symfony\Component\Security\Core\User\AccountInterface');
+ $token = $this->getMock('Symfony\Component\Security\Core\Authentication\Token\TokenInterface');
$token
->expects($this->once())
->method('getUser')
@@ -158,8 +158,8 @@ class RememberMeServicesTest extends \PHPUnit_Framework_TestCase
$request = new Request;
$request->request->set('foo', $value);
$response = new Response;
- $account = $this->getMock('Symfony\Component\Security\User\AccountInterface');
- $token = $this->getMock('Symfony\Component\Security\Authentication\Token\TokenInterface');
+ $account = $this->getMock('Symfony\Component\Security\Core\User\AccountInterface');
+ $token = $this->getMock('Symfony\Component\Security\Core\Authentication\Token\TokenInterface');
$token
->expects($this->once())
->method('getUser')
@@ -190,7 +190,7 @@ class RememberMeServicesTest extends \PHPUnit_Framework_TestCase
$service = $this->getService();
$token = $this->getMock(
- 'Symfony\Component\Security\Authentication\Token\RememberMeToken',
+ 'Symfony\Component\Security\Core\Authentication\Token\RememberMeToken',
array(),
array(),
'NonFunctionalRememberMeTokenMockClass',
@@ -212,14 +212,14 @@ class RememberMeServicesTest extends \PHPUnit_Framework_TestCase
$userProvider = $this->getProvider();
}
- return $this->getMockForAbstractClass('Symfony\Bundle\SecurityBundle\Security\RememberMe\RememberMeServices', array(
+ return $this->getMockForAbstractClass('Symfony\Component\Security\Http\RememberMe\RememberMeServices', array(
array($userProvider), 'fookey', 'fookey', $options, $logger
));
}
protected function getProvider()
{
- $provider = $this->getMock('Symfony\Component\Security\User\UserProviderInterface');
+ $provider = $this->getMock('Symfony\Component\Security\Core\User\UserProviderInterface');
$provider
->expects($this->any())
->method('supportsClass')
diff --git a/src/Symfony/Bundle/SecurityBundle/Tests/Security/RememberMe/TokenBasedRememberMeServicesTest.php b/tests/Symfony/Tests/Component/Security/Http/RememberMe/TokenBasedRememberMeServicesTest.php
similarity index 82%
rename from src/Symfony/Bundle/SecurityBundle/Tests/Security/RememberMe/TokenBasedRememberMeServicesTest.php
rename to tests/Symfony/Tests/Component/Security/Http/RememberMe/TokenBasedRememberMeServicesTest.php
index cb3fdb0860..5ae4540586 100644
--- a/src/Symfony/Bundle/SecurityBundle/Tests/Security/RememberMe/TokenBasedRememberMeServicesTest.php
+++ b/tests/Symfony/Tests/Component/Security/Http/RememberMe/TokenBasedRememberMeServicesTest.php
@@ -1,16 +1,16 @@
cookies->set('foo', base64_encode('class:'.base64_encode('foouser').':123456789:fooHash'));
- $user = $this->getMock('Symfony\Component\Security\User\AccountInterface');
+ $user = $this->getMock('Symfony\Component\Security\Core\User\AccountInterface');
$user
->expects($this->once())
->method('getPassword')
@@ -83,7 +83,7 @@ class TokenBasedRememberMeServicesTest extends \PHPUnit_Framework_TestCase
}
/**
- * @expectedException Symfony\Component\Security\Exception\AuthenticationException
+ * @expectedException Symfony\Component\Security\Core\Exception\AuthenticationException
* @expectedMessage The cookie has expired.
*/
public function testAutoLoginDoesNotAcceptAnExpiredCookie()
@@ -93,7 +93,7 @@ class TokenBasedRememberMeServicesTest extends \PHPUnit_Framework_TestCase
$request = new Request;
$request->cookies->set('foo', $this->getCookie('fooclass', 'foouser', time() - 1, 'foopass'));
- $user = $this->getMock('Symfony\Component\Security\User\AccountInterface');
+ $user = $this->getMock('Symfony\Component\Security\Core\User\AccountInterface');
$user
->expects($this->once())
->method('getPassword')
@@ -112,7 +112,7 @@ class TokenBasedRememberMeServicesTest extends \PHPUnit_Framework_TestCase
public function testAutoLogin()
{
- $user = $this->getMock('Symfony\Component\Security\User\AccountInterface');
+ $user = $this->getMock('Symfony\Component\Security\Core\User\AccountInterface');
$user
->expects($this->once())
->method('getRoles')
@@ -138,7 +138,7 @@ class TokenBasedRememberMeServicesTest extends \PHPUnit_Framework_TestCase
$returnedToken = $service->autoLogin($request);
- $this->assertInstanceOf('Symfony\Component\Security\Authentication\Token\RememberMeToken', $returnedToken);
+ $this->assertInstanceOf('Symfony\Component\Security\Core\Authentication\Token\RememberMeToken', $returnedToken);
$this->assertSame($user, $returnedToken->getUser());
$this->assertEquals('fookey', $returnedToken->getKey());
}
@@ -148,7 +148,7 @@ class TokenBasedRememberMeServicesTest extends \PHPUnit_Framework_TestCase
$service = $this->getService(null, array('name' => 'foo', 'path' => null, 'domain' => null));
$request = new Request();
$response = new Response();
- $token = $this->getMock('Symfony\Component\Security\Authentication\Token\TokenInterface');
+ $token = $this->getMock('Symfony\Component\Security\Core\Authentication\Token\TokenInterface');
$this->assertFalse($response->headers->hasCookie('foo'));
@@ -182,7 +182,7 @@ class TokenBasedRememberMeServicesTest extends \PHPUnit_Framework_TestCase
$request = new Request;
$response = new Response;
- $user = $this->getMock('Symfony\Component\Security\User\AccountInterface');
+ $user = $this->getMock('Symfony\Component\Security\Core\User\AccountInterface');
$user
->expects($this->once())
->method('getRoles')
@@ -203,7 +203,7 @@ class TokenBasedRememberMeServicesTest extends \PHPUnit_Framework_TestCase
$service = $this->getService(null, array('name' => 'foo', 'always_remember_me' => true));
$request = new Request;
$response = new Response;
- $token = $this->getMock('Symfony\Component\Security\Authentication\Token\TokenInterface');
+ $token = $this->getMock('Symfony\Component\Security\Core\Authentication\Token\TokenInterface');
$token
->expects($this->once())
->method('getUser')
@@ -223,8 +223,8 @@ class TokenBasedRememberMeServicesTest extends \PHPUnit_Framework_TestCase
$request = new Request;
$response = new Response;
- $token = $this->getMock('Symfony\Component\Security\Authentication\Token\TokenInterface');
- $user = $this->getMock('Symfony\Component\Security\User\AccountInterface');
+ $token = $this->getMock('Symfony\Component\Security\Core\Authentication\Token\TokenInterface');
+ $user = $this->getMock('Symfony\Component\Security\Core\User\AccountInterface');
$user
->expects($this->once())
->method('getPassword')
@@ -285,7 +285,7 @@ class TokenBasedRememberMeServicesTest extends \PHPUnit_Framework_TestCase
protected function getProvider()
{
- $provider = $this->getMock('Symfony\Component\Security\User\UserProviderInterface');
+ $provider = $this->getMock('Symfony\Component\Security\Core\User\UserProviderInterface');
$provider
->expects($this->any())
->method('supportsClass')