diff options
author | Fabien Potencier <fabien.potencier@gmail.com> | 2013-12-30 22:49:15 +0100 |
---|---|---|
committer | Fabien Potencier <fabien.potencier@gmail.com> | 2013-12-31 11:55:25 +0100 |
commit | f3427fa7d44637866e038bf49ae336509e99800b (patch) | |
tree | 9c05b8561074da10ab033cc31e7b63652fea6f65 /Tests/Core/User | |
parent | 47a99c77ac4ea45ab1e20b3d95450cd39204e123 (diff) | |
download | symfony-security-f3427fa7d44637866e038bf49ae336509e99800b.zip symfony-security-f3427fa7d44637866e038bf49ae336509e99800b.tar.gz symfony-security-f3427fa7d44637866e038bf49ae336509e99800b.tar.bz2 |
[Security] fixed pre/post authentication checks
Diffstat (limited to 'Tests/Core/User')
-rw-r--r-- | Tests/Core/User/UserCheckerTest.php | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/Tests/Core/User/UserCheckerTest.php b/Tests/Core/User/UserCheckerTest.php index f28067f..dca6311 100644 --- a/Tests/Core/User/UserCheckerTest.php +++ b/Tests/Core/User/UserCheckerTest.php @@ -15,44 +15,44 @@ use Symfony\Component\Security\Core\User\UserChecker; class UserCheckerTest extends \PHPUnit_Framework_TestCase { - public function testCheckPreAuthNotAdvancedUserInterface() + public function testCheckPostAuthNotAdvancedUserInterface() { $checker = new UserChecker(); - $this->assertNull($checker->checkPreAuth($this->getMock('Symfony\Component\Security\Core\User\UserInterface'))); + $this->assertNull($checker->checkPostAuth($this->getMock('Symfony\Component\Security\Core\User\UserInterface'))); } - public function testCheckPreAuthPass() + public function testCheckPostAuthPass() { $checker = new UserChecker(); $account = $this->getMock('Symfony\Component\Security\Core\User\AdvancedUserInterface'); $account->expects($this->once())->method('isCredentialsNonExpired')->will($this->returnValue(true)); - $this->assertNull($checker->checkPreAuth($account)); + $this->assertNull($checker->checkPostAuth($account)); } /** * @expectedException \Symfony\Component\Security\Core\Exception\CredentialsExpiredException */ - public function testCheckPreAuthCredentialsExpired() + public function testCheckPostAuthCredentialsExpired() { $checker = new UserChecker(); $account = $this->getMock('Symfony\Component\Security\Core\User\AdvancedUserInterface'); $account->expects($this->once())->method('isCredentialsNonExpired')->will($this->returnValue(false)); - $checker->checkPreAuth($account); + $checker->checkPostAuth($account); } - public function testCheckPostAuthNotAdvancedUserInterface() + public function testCheckPreAuthNotAdvancedUserInterface() { $checker = new UserChecker(); - $this->assertNull($checker->checkPostAuth($this->getMock('Symfony\Component\Security\Core\User\UserInterface'))); + $this->assertNull($checker->checkPreAuth($this->getMock('Symfony\Component\Security\Core\User\UserInterface'))); } - public function testCheckPostAuthPass() + public function testCheckPreAuthPass() { $checker = new UserChecker(); @@ -61,26 +61,26 @@ class UserCheckerTest extends \PHPUnit_Framework_TestCase $account->expects($this->once())->method('isEnabled')->will($this->returnValue(true)); $account->expects($this->once())->method('isAccountNonExpired')->will($this->returnValue(true)); - $this->assertNull($checker->checkPostAuth($account)); + $this->assertNull($checker->checkPreAuth($account)); } /** * @expectedException \Symfony\Component\Security\Core\Exception\LockedException */ - public function testCheckPostAuthAccountLocked() + public function testCheckPreAuthAccountLocked() { $checker = new UserChecker(); $account = $this->getMock('Symfony\Component\Security\Core\User\AdvancedUserInterface'); $account->expects($this->once())->method('isAccountNonLocked')->will($this->returnValue(false)); - $checker->checkPostAuth($account); + $checker->checkPreAuth($account); } /** * @expectedException \Symfony\Component\Security\Core\Exception\DisabledException */ - public function testCheckPostAuthDisabled() + public function testCheckPreAuthDisabled() { $checker = new UserChecker(); @@ -88,13 +88,13 @@ class UserCheckerTest extends \PHPUnit_Framework_TestCase $account->expects($this->once())->method('isAccountNonLocked')->will($this->returnValue(true)); $account->expects($this->once())->method('isEnabled')->will($this->returnValue(false)); - $checker->checkPostAuth($account); + $checker->checkPreAuth($account); } /** * @expectedException \Symfony\Component\Security\Core\Exception\AccountExpiredException */ - public function testCheckPostAuthAccountExpired() + public function testCheckPreAuthAccountExpired() { $checker = new UserChecker(); @@ -103,6 +103,6 @@ class UserCheckerTest extends \PHPUnit_Framework_TestCase $account->expects($this->once())->method('isEnabled')->will($this->returnValue(true)); $account->expects($this->once())->method('isAccountNonExpired')->will($this->returnValue(false)); - $checker->checkPostAuth($account); + $checker->checkPreAuth($account); } } |