diff options
author | Fabien Potencier <fabien.potencier@gmail.com> | 2013-10-10 15:12:30 +0200 |
---|---|---|
committer | Fabien Potencier <fabien.potencier@gmail.com> | 2013-10-10 15:12:30 +0200 |
commit | b6d302f1f0f1235aa376c180dcd289f38b3df70e (patch) | |
tree | 676aa0d8ce931531f31494da3f65a2d8f12bb967 /Tests/Core/Encoder/PlaintextPasswordEncoderTest.php | |
parent | 5d889265454c4b094e894a14f0d9b4687fa644e1 (diff) | |
parent | 41cbe3694a5332d7e5bdb285c81bbfe23f31a220 (diff) | |
download | symfony-security-b6d302f1f0f1235aa376c180dcd289f38b3df70e.zip symfony-security-b6d302f1f0f1235aa376c180dcd289f38b3df70e.tar.gz symfony-security-b6d302f1f0f1235aa376c180dcd289f38b3df70e.tar.bz2 |
Merge branch '2.2' into 2.3v2.3.6
* 2.2:
bumped Symfony version to 2.2.10
updated VERSION for 2.2.9
update CONTRIBUTORS for 2.2.9
updated CHANGELOG for 2.2.9
[Security] limited the password length passed to encoders
assets:install command should mirror .dotfiles (.htaccess)
PoFileDumper - PO headers
removed whitespaces
Conflicts:
src/Symfony/Component/HttpKernel/Kernel.php
src/Symfony/Component/Security/Core/Encoder/BCryptPasswordEncoder.php
Diffstat (limited to 'Tests/Core/Encoder/PlaintextPasswordEncoderTest.php')
-rw-r--r-- | Tests/Core/Encoder/PlaintextPasswordEncoderTest.php | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/Tests/Core/Encoder/PlaintextPasswordEncoderTest.php b/Tests/Core/Encoder/PlaintextPasswordEncoderTest.php index af0008f..8b1b888 100644 --- a/Tests/Core/Encoder/PlaintextPasswordEncoderTest.php +++ b/Tests/Core/Encoder/PlaintextPasswordEncoderTest.php @@ -36,4 +36,21 @@ class PlaintextPasswordEncoderTest extends \PHPUnit_Framework_TestCase $this->assertSame('foo', $encoder->encodePassword('foo', '')); } + + /** + * @expectedException \Symfony\Component\Security\Core\Exception\BadCredentialsException + */ + public function testEncodePasswordLength() + { + $encoder = new PlaintextPasswordEncoder(); + + $encoder->encodePassword(str_repeat('a', 5000), 'salt'); + } + + public function testCheckPasswordLength() + { + $encoder = new PlaintextPasswordEncoder(); + + $this->assertFalse($encoder->isPasswordValid('encoded', str_repeat('a', 5000), 'salt')); + } } |