From ddc207fae83ad260f592c6a99c83971263e7eb5a Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Sat, 29 Jun 2013 00:04:02 +0200 Subject: [PATCH] [feature/passwords] Fix tests on PHP versions < 5.3.7 PHPBB3-11610 --- tests/crypto/manager_test.php | 56 ++++++++++++++++++++++++----------- 1 file changed, 38 insertions(+), 18 deletions(-) diff --git a/tests/crypto/manager_test.php b/tests/crypto/manager_test.php index 9b14383f5d..f2eb9a160b 100644 --- a/tests/crypto/manager_test.php +++ b/tests/crypto/manager_test.php @@ -128,24 +128,44 @@ class phpbb_crypto_manager_test extends PHPUnit_Framework_TestCase public function test_combined_hash_data() { - return array( - array( - 'crypto.driver.salted_md5', - array('crypto.driver.bcrypt_2y'), - ), - array( - 'crypto.driver.salted_md5', - array('crypto.driver.bcrypt'), - ), - array( - 'crypto.driver.phpass', - array('crypto.driver.salted_md5'), - ), - array( - 'crypto.driver.salted_md5', - array('crypto.driver.bcrypt_2y', 'crypto.driver.bcrypt'), - ), - ); + if (version_compare(PHP_VERSION, '5.3.7', '<')) + { + return array( + array( + 'crypto.driver.salted_md5', + array('crypto.driver.bcrypt'), + ), + array( + 'crypto.driver.phpass', + array('crypto.driver.salted_md5'), + ), + array( + 'crypto.driver.salted_md5', + array('crypto.driver.phpass', 'crypto.driver.bcrypt'), + ), + ); + } + else + { + return array( + array( + 'crypto.driver.salted_md5', + array('crypto.driver.bcrypt_2y'), + ), + array( + 'crypto.driver.salted_md5', + array('crypto.driver.bcrypt'), + ), + array( + 'crypto.driver.phpass', + array('crypto.driver.salted_md5'), + ), + array( + 'crypto.driver.salted_md5', + array('crypto.driver.bcrypt_2y', 'crypto.driver.bcrypt'), + ), + ); + } } /**