summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFabien Potencier <fabien.potencier@gmail.com>2014-09-25 10:51:47 +0200
committerFabien Potencier <fabien.potencier@gmail.com>2014-09-25 10:51:47 +0200
commit659aaeaa6f12334c2946acaeca5f530f8caa74bb (patch)
tree5cf776478dbc00ad7f14fef51b916f8cbe402ed1
parentd24ad02240ec3f37fe146671340373f7567ad6c9 (diff)
parent405a9bfe52e8041181fc7b8314c23a3ba05a4bab (diff)
downloadsymfony-security-659aaeaa6f12334c2946acaeca5f530f8caa74bb.zip
symfony-security-659aaeaa6f12334c2946acaeca5f530f8caa74bb.tar.gz
symfony-security-659aaeaa6f12334c2946acaeca5f530f8caa74bb.tar.bz2
Merge branch '2.3' into 2.4
* 2.3: remove obsolete test file [FrameworkBundle] output failed matched path for clarification bug #10242 Missing checkPreAuth from RememberMeAuthenticationProvider [Validator] Fixed StaticMethodLoaderTest to actually test something [Form] Fixed ValidatorTypeGuesser to guess properties without constraints not to be required Use request format from request in twig ExceptionController [Form] Moved POST_MAX_SIZE validation from FormValidator to request handler [Form] Add a form error if post_max_size has been reached. Response::isNotModified returns true when If-Modified-Since is later than Last-Modified [WebProfilerBundle] turbolinks compatibility Conflicts: src/Symfony/Component/Form/CHANGELOG.md src/Symfony/Component/HttpFoundation/Tests/ResponseTest.php src/Symfony/Component/Security/Core/Tests/Authentication/Provider/RememberMeAuthenticationProviderTest.php
-rw-r--r--Core/Authentication/Provider/RememberMeAuthenticationProvider.php2
-rw-r--r--Core/Tests/Authentication/Provider/RememberMeAuthenticationProviderTest.php20
2 files changed, 9 insertions, 13 deletions
diff --git a/Core/Authentication/Provider/RememberMeAuthenticationProvider.php b/Core/Authentication/Provider/RememberMeAuthenticationProvider.php
index 234bddb..82be1d1 100644
--- a/Core/Authentication/Provider/RememberMeAuthenticationProvider.php
+++ b/Core/Authentication/Provider/RememberMeAuthenticationProvider.php
@@ -50,7 +50,7 @@ class RememberMeAuthenticationProvider implements AuthenticationProviderInterfac
}
$user = $token->getUser();
- $this->userChecker->checkPostAuth($user);
+ $this->userChecker->checkPreAuth($user);
$authenticatedToken = new RememberMeToken($user, $this->providerKey, $this->key);
$authenticatedToken->setAttributes($token->getAttributes());
diff --git a/Core/Tests/Authentication/Provider/RememberMeAuthenticationProviderTest.php b/Core/Tests/Authentication/Provider/RememberMeAuthenticationProviderTest.php
index d31bf9d..a6fff4b 100644
--- a/Core/Tests/Authentication/Provider/RememberMeAuthenticationProviderTest.php
+++ b/Core/Tests/Authentication/Provider/RememberMeAuthenticationProviderTest.php
@@ -12,7 +12,7 @@
namespace Symfony\Component\Security\Core\Tests\Authentication\Provider;
use Symfony\Component\Security\Core\Authentication\Provider\RememberMeAuthenticationProvider;
-use Symfony\Component\Security\Core\Authentication\Token\RememberMeToken;
+use Symfony\Component\Security\Core\Exception\DisabledException;
use Symfony\Component\Security\Core\Role\Role;
class RememberMeAuthenticationProviderTest extends \PHPUnit_Framework_TestCase
@@ -45,15 +45,14 @@ class RememberMeAuthenticationProviderTest extends \PHPUnit_Framework_TestCase
}
/**
- * @expectedException \Symfony\Component\Security\Core\Exception\AccountExpiredException
+ * @expectedException \Symfony\Component\Security\Core\Exception\DisabledException
*/
- public function testAuthenticateWhenPostChecksFails()
+ public function testAuthenticateWhenPreChecksFails()
{
$userChecker = $this->getMock('Symfony\Component\Security\Core\User\UserCheckerInterface');
$userChecker->expects($this->once())
- ->method('checkPostAuth')
- ->will($this->throwException($this->getMock('Symfony\Component\Security\Core\Exception\AccountExpiredException', null, array(), '')))
- ;
+ ->method('checkPreAuth')
+ ->will($this->throwException(new DisabledException()));
$provider = $this->getProvider($userChecker);
@@ -65,8 +64,7 @@ class RememberMeAuthenticationProviderTest extends \PHPUnit_Framework_TestCase
$user = $this->getMock('Symfony\Component\Security\Core\User\UserInterface');
$user->expects($this->exactly(2))
->method('getRoles')
- ->will($this->returnValue(array('ROLE_FOO')))
- ;
+ ->will($this->returnValue(array('ROLE_FOO')));
$provider = $this->getProvider();
@@ -86,16 +84,14 @@ class RememberMeAuthenticationProviderTest extends \PHPUnit_Framework_TestCase
$user
->expects($this->any())
->method('getRoles')
- ->will($this->returnValue(array()))
- ;
+ ->will($this->returnValue(array()));
}
$token = $this->getMock('Symfony\Component\Security\Core\Authentication\Token\RememberMeToken', array('getProviderKey'), array($user, 'foo', $key));
$token
->expects($this->once())
->method('getProviderKey')
- ->will($this->returnValue('foo'))
- ;
+ ->will($this->returnValue('foo'));
return $token;
}