From 7c347864a4388ceac780ef25c4cee680ef80aaf4 Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Thu, 10 Oct 2013 12:09:50 +0200 Subject: [PATCH] [feature/passwords] Fix tests for 8th bit characters in bcrypt on PHP < 5.3.7 PHPBB3-11610 --- tests/passwords/manager_test.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/tests/passwords/manager_test.php b/tests/passwords/manager_test.php index 77955bd464..f68ca25a2f 100644 --- a/tests/passwords/manager_test.php +++ b/tests/passwords/manager_test.php @@ -170,7 +170,14 @@ class phpbb_passwords_manager_test extends PHPUnit_Framework_TestCase public function test_hash_password_8bit_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()