[feature/passwords] Fix tests for 8th bit characters in bcrypt on PHP < 5.3.7

PHPBB3-11610
This commit is contained in:
Marc Alexander 2013-10-10 12:09:50 +02:00
parent fdf9ae7c18
commit 7c347864a4

View file

@ -170,7 +170,14 @@ class phpbb_passwords_manager_test extends PHPUnit_Framework_TestCase
public function test_hash_password_8bit_bcrypt() public function test_hash_password_8bit_bcrypt()
{ {
$this->assertEquals(false, $this->manager->hash('foobar𝄞', 'passwords.driver.bcrypt')); $this->assertEquals(false, $this->manager->hash('foobar𝄞', 'passwords.driver.bcrypt'));
$this->assertNotEquals(false, $this->manager->hash('foobar𝄞', 'passwords.driver.bcrypt_2y')); if (version_compare(PHP_VERSION, '5.3.7', '<'))
{
$this->assertEquals(false, $this->manager->hash('foobar𝄞', 'passwords.driver.bcrypt_2y'));
}
else
{
$this->assertNotEquals(false, $this->manager->hash('foobar𝄞', 'passwords.driver.bcrypt_2y'));
}
} }
public function test_combined_hash_data() public function test_combined_hash_data()