summaryrefslogtreecommitdiffstats
path: root/Core/Tests/Encoder/BCryptPasswordEncoderTest.php
diff options
context:
space:
mode:
authorFabien Potencier <fabien.potencier@gmail.com>2013-10-10 16:19:44 +0200
committerFabien Potencier <fabien.potencier@gmail.com>2013-10-10 16:19:44 +0200
commitc6bcb7699b39b8575cbd5527d9f65428500163ba (patch)
treec37394d4e3abd73ea35cc52c462f40e857b11b05 /Core/Tests/Encoder/BCryptPasswordEncoderTest.php
parent8780aecc6088ec65909d68dfebd867dfa99a0d77 (diff)
parentb6d302f1f0f1235aa376c180dcd289f38b3df70e (diff)
downloadsymfony-security-c6bcb7699b39b8575cbd5527d9f65428500163ba.zip
symfony-security-c6bcb7699b39b8575cbd5527d9f65428500163ba.tar.gz
symfony-security-c6bcb7699b39b8575cbd5527d9f65428500163ba.tar.bz2
Merge branch '2.3'
* 2.3: bumped Symfony version to 2.3.7 updated VERSION for 2.3.6 updated CHANGELOG for 2.3.6 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 [HttpKernel] Fixed a test (compiler pass class name has been changed). 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 src/Symfony/Component/Security/Core/Encoder/BasePasswordEncoder.php src/Symfony/Component/Security/Core/Encoder/MessageDigestPasswordEncoder.php src/Symfony/Component/Security/Core/Encoder/Pbkdf2PasswordEncoder.php src/Symfony/Component/Security/Core/Encoder/PlaintextPasswordEncoder.php src/Symfony/Component/Security/Core/Tests/Encoder/MessageDigestPasswordEncoderTest.php src/Symfony/Component/Security/Core/Tests/Encoder/Pbkdf2PasswordEncoderTest.php src/Symfony/Component/Security/Core/Tests/Encoder/PlaintextPasswordEncoderTest.php
Diffstat (limited to 'Core/Tests/Encoder/BCryptPasswordEncoderTest.php')
-rw-r--r--Core/Tests/Encoder/BCryptPasswordEncoderTest.php23
1 files changed, 10 insertions, 13 deletions
diff --git a/Core/Tests/Encoder/BCryptPasswordEncoderTest.php b/Core/Tests/Encoder/BCryptPasswordEncoderTest.php
index 99f03a3..2213dc5 100644
--- a/Core/Tests/Encoder/BCryptPasswordEncoderTest.php
+++ b/Core/Tests/Encoder/BCryptPasswordEncoderTest.php
@@ -64,30 +64,27 @@ class BCryptPasswordEncoderTest extends \PHPUnit_Framework_TestCase
$this->assertFalse($encoder->isPasswordValid($result, 'anotherPassword', null));
}
+ private function skipIfPhpVersionIsNotSupported()
+ {
+ if (version_compare(phpversion(), '5.3.7', '<')) {
+ $this->markTestSkipped('Requires PHP >= 5.3.7');
+ }
+ }
+
/**
* @expectedException \Symfony\Component\Security\Core\Exception\BadCredentialsException
*/
public function testEncodePasswordLength()
{
- $encoder = new BCryptPasswordEncoder(4);
+ $encoder = new BCryptPasswordEncoder(self::VALID_COST);
$encoder->encodePassword(str_repeat('a', 5000), 'salt');
}
- /**
- * @expectedException \Symfony\Component\Security\Core\Exception\BadCredentialsException
- */
public function testCheckPasswordLength()
{
- $encoder = new BCryptPasswordEncoder(4);
-
- $encoder->isPasswordValid('encoded', str_repeat('a', 5000), 'salt');
- }
+ $encoder = new BCryptPasswordEncoder(self::VALID_COST);
- private function skipIfPhpVersionIsNotSupported()
- {
- if (version_compare(phpversion(), '5.3.7', '<')) {
- $this->markTestSkipped('Requires PHP >= 5.3.7');
- }
+ $this->assertFalse($encoder->isPasswordValid('encoded', str_repeat('a', 5000), 'salt'));
}
}