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/BCryptPasswordEncoderTest.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/BCryptPasswordEncoderTest.php')
-rw-r--r-- | Tests/Core/Encoder/BCryptPasswordEncoderTest.php | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/Tests/Core/Encoder/BCryptPasswordEncoderTest.php b/Tests/Core/Encoder/BCryptPasswordEncoderTest.php index 49c1051..dd962fd 100644 --- a/Tests/Core/Encoder/BCryptPasswordEncoderTest.php +++ b/Tests/Core/Encoder/BCryptPasswordEncoderTest.php @@ -70,4 +70,21 @@ class BCryptPasswordEncoderTest extends \PHPUnit_Framework_TestCase $this->markTestSkipped('Requires PHP >= 5.3.7'); } } + + /** + * @expectedException \Symfony\Component\Security\Core\Exception\BadCredentialsException + */ + public function testEncodePasswordLength() + { + $encoder = new BCryptPasswordEncoder(self::VALID_COST); + + $encoder->encodePassword(str_repeat('a', 5000), 'salt'); + } + + public function testCheckPasswordLength() + { + $encoder = new BCryptPasswordEncoder(self::VALID_COST); + + $this->assertFalse($encoder->isPasswordValid('encoded', str_repeat('a', 5000), 'salt')); + } } |