summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian Flothmann <christian.flothmann@gmail.com>2015-12-22 09:19:23 +0100
committerChristian Flothmann <christian.flothmann@gmail.com>2015-12-22 09:19:23 +0100
commit3cc1034becc10c507ec891414457d5f826ff405f (patch)
tree994a4bc6c508f77a89247cb2331e104d0c3f45e0
parent5cbd8b6132fcf0d12e827cad0f0cd851af806feb (diff)
downloadsymfony-security-3cc1034becc10c507ec891414457d5f826ff405f.zip
symfony-security-3cc1034becc10c507ec891414457d5f826ff405f.tar.gz
symfony-security-3cc1034becc10c507ec891414457d5f826ff405f.tar.bz2
use requires annotationv2.3.36
-rw-r--r--Tests/Core/Encoder/BCryptPasswordEncoderTest.php22
1 files changed, 9 insertions, 13 deletions
diff --git a/Tests/Core/Encoder/BCryptPasswordEncoderTest.php b/Tests/Core/Encoder/BCryptPasswordEncoderTest.php
index b3ddff6..9894c6f 100644
--- a/Tests/Core/Encoder/BCryptPasswordEncoderTest.php
+++ b/Tests/Core/Encoder/BCryptPasswordEncoderTest.php
@@ -45,19 +45,21 @@ class BCryptPasswordEncoderTest extends \PHPUnit_Framework_TestCase
}
}
+ /**
+ * @requires PHP 5.3.7
+ */
public function testResultLength()
{
- $this->skipIfPhpVersionIsNotSupported();
-
$encoder = new BCryptPasswordEncoder(self::VALID_COST);
$result = $encoder->encodePassword(self::PASSWORD, null);
$this->assertEquals(60, strlen($result));
}
+ /**
+ * @requires PHP 5.3.7
+ */
public function testValidation()
{
- $this->skipIfPhpVersionIsNotSupported();
-
$encoder = new BCryptPasswordEncoder(self::VALID_COST);
$result = $encoder->encodePassword(self::PASSWORD, null);
$this->assertTrue($encoder->isPasswordValid($result, self::PASSWORD, null));
@@ -74,21 +76,15 @@ class BCryptPasswordEncoderTest extends \PHPUnit_Framework_TestCase
$encoder->encodePassword(str_repeat('a', 73), 'salt');
}
+ /**
+ * @requires PHP 5.3.7
+ */
public function testCheckPasswordLength()
{
- $this->skipIfPhpVersionIsNotSupported();
-
$encoder = new BCryptPasswordEncoder(self::VALID_COST);
$result = $encoder->encodePassword(str_repeat('a', 72), null);
$this->assertFalse($encoder->isPasswordValid($result, str_repeat('a', 73), 'salt'));
$this->assertTrue($encoder->isPasswordValid($result, str_repeat('a', 72), 'salt'));
}
-
- private function skipIfPhpVersionIsNotSupported()
- {
- if (PHP_VERSION_ID < 50307 && !\PasswordCompat\binary\check()) {
- $this->markTestSkipped('Skipping test as this PHP version is not compatible with the ircmaxell/password-compat library.');
- }
- }
}