diff options
author | Fabien Potencier <fabien.potencier@gmail.com> | 2010-10-31 13:22:50 +0100 |
---|---|---|
committer | Fabien Potencier <fabien.potencier@gmail.com> | 2010-10-31 13:39:12 +0100 |
commit | 0ac635c153de6ce16d2a869c205c52ed0546a223 (patch) | |
tree | 9f320bdc3a3b2f47cf630a1f015f5bccc9bb3c37 /Authentication/Provider | |
parent | 6df1393216e1568f45eac7942c5230f45da3b6e3 (diff) | |
download | symfony-security-0ac635c153de6ce16d2a869c205c52ed0546a223.zip symfony-security-0ac635c153de6ce16d2a869c205c52ed0546a223.tar.gz symfony-security-0ac635c153de6ce16d2a869c205c52ed0546a223.tar.bz2 |
[Security] added unit tests for the Authentication sub-namespace
Diffstat (limited to 'Authentication/Provider')
-rw-r--r-- | Authentication/Provider/DaoAuthenticationProvider.php | 4 | ||||
-rw-r--r-- | Authentication/Provider/PreAuthenticatedAuthenticationProvider.php | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/Authentication/Provider/DaoAuthenticationProvider.php b/Authentication/Provider/DaoAuthenticationProvider.php index b5ae27c..a4fb4c7 100644 --- a/Authentication/Provider/DaoAuthenticationProvider.php +++ b/Authentication/Provider/DaoAuthenticationProvider.php @@ -39,9 +39,9 @@ class DaoAuthenticationProvider extends UserAuthenticationProvider * @param AccountCheckerInterface $accountChecker An AccountCheckerInterface instance * @param PasswordEncoderInterface $passwordEncoder A PasswordEncoderInterface instance */ - public function __construct(UserProviderInterface $userProvider, AccountCheckerInterface $accountChecker, PasswordEncoderInterface $passwordEncoder = null) + public function __construct(UserProviderInterface $userProvider, AccountCheckerInterface $accountChecker, PasswordEncoderInterface $passwordEncoder = null, $hideUserNotFoundExceptions = true) { - parent::__construct($accountChecker); + parent::__construct($accountChecker, $hideUserNotFoundExceptions); if (null === $passwordEncoder) { $passwordEncoder = new PlaintextPasswordEncoder(); diff --git a/Authentication/Provider/PreAuthenticatedAuthenticationProvider.php b/Authentication/Provider/PreAuthenticatedAuthenticationProvider.php index 1494dcf..e161323 100644 --- a/Authentication/Provider/PreAuthenticatedAuthenticationProvider.php +++ b/Authentication/Provider/PreAuthenticatedAuthenticationProvider.php @@ -53,7 +53,7 @@ class PreAuthenticatedAuthenticationProvider implements AuthenticationProviderIn return null; } - if (null === $token->getUser()) { + if (!$user = $token->getUser()) { throw new BadCredentialsException('No pre-authenticated principal found in request.'); } /* @@ -61,7 +61,7 @@ class PreAuthenticatedAuthenticationProvider implements AuthenticationProviderIn throw new BadCredentialsException('No pre-authenticated credentials found in request.'); } */ - $user = $this->userProvider->loadUserByUsername($token->getUser()); + $user = $this->userProvider->loadUserByUsername($user); $this->accountChecker->checkPostAuth($user); |