diff options
author | Jakub Zalas <jakub@zalas.pl> | 2013-05-10 22:26:48 +0100 |
---|---|---|
committer | Jakub Zalas <jakub@zalas.pl> | 2013-05-10 22:34:58 +0100 |
commit | d75c3de9d5f070d1a812bca11db57248a21eb1db (patch) | |
tree | dd66c94f6f40e83bf0a6921bc7138030791796b1 /Tests/Core/Encoder | |
parent | 38520edbb31cdba5c83e03184f515a6e430ed4f1 (diff) | |
download | symfony-security-d75c3de9d5f070d1a812bca11db57248a21eb1db.zip symfony-security-d75c3de9d5f070d1a812bca11db57248a21eb1db.tar.gz symfony-security-d75c3de9d5f070d1a812bca11db57248a21eb1db.tar.bz2 |
[Security] Disabled the BCryptPasswordEncoder tests for PHP versions lower than 5.3.7.
See https://github.com/ircmaxell/password_compat/issues/10#issuecomment-11203833.
Diffstat (limited to 'Tests/Core/Encoder')
-rw-r--r-- | Tests/Core/Encoder/BCryptPasswordEncoderTest.php | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/Tests/Core/Encoder/BCryptPasswordEncoderTest.php b/Tests/Core/Encoder/BCryptPasswordEncoderTest.php index 6378433..49c1051 100644 --- a/Tests/Core/Encoder/BCryptPasswordEncoderTest.php +++ b/Tests/Core/Encoder/BCryptPasswordEncoderTest.php @@ -47,6 +47,8 @@ class BCryptPasswordEncoderTest extends \PHPUnit_Framework_TestCase public function testResultLength() { + $this->skipIfPhpVersionIsNotSupported(); + $encoder = new BCryptPasswordEncoder(self::VALID_COST); $result = $encoder->encodePassword(self::PASSWORD, null); $this->assertEquals(60, strlen($result)); @@ -54,9 +56,18 @@ class BCryptPasswordEncoderTest extends \PHPUnit_Framework_TestCase 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)); $this->assertFalse($encoder->isPasswordValid($result, 'anotherPassword', null)); } + + private function skipIfPhpVersionIsNotSupported() + { + if (version_compare(phpversion(), '5.3.7', '<')) { + $this->markTestSkipped('Requires PHP >= 5.3.7'); + } + } } |