summaryrefslogtreecommitdiffstats
path: root/Tests/Core/Encoder/BCryptPasswordEncoderTest.php
diff options
context:
space:
mode:
authorFabien Potencier <fabien.potencier@gmail.com>2013-10-10 15:12:30 +0200
committerFabien Potencier <fabien.potencier@gmail.com>2013-10-10 15:12:30 +0200
commitb6d302f1f0f1235aa376c180dcd289f38b3df70e (patch)
tree676aa0d8ce931531f31494da3f65a2d8f12bb967 /Tests/Core/Encoder/BCryptPasswordEncoderTest.php
parent5d889265454c4b094e894a14f0d9b4687fa644e1 (diff)
parent41cbe3694a5332d7e5bdb285c81bbfe23f31a220 (diff)
downloadsymfony-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.php17
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'));
+ }
}