From 13d25e6a327728fc5bc28759ffe9f2248f6cb9a0 Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Sat, 15 Jun 2013 16:35:27 +0200 Subject: [PATCH] [feature/passwords] Fix tests for PHP version < 5.3.7 PHPBB3-11610 --- tests/crypto/manager_test.php | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/tests/crypto/manager_test.php b/tests/crypto/manager_test.php index b5957d5f85..eb1a0eeed3 100644 --- a/tests/crypto/manager_test.php +++ b/tests/crypto/manager_test.php @@ -45,12 +45,24 @@ class phpbb_crypto_manager_test extends PHPUnit_Framework_TestCase public function hash_password_data() { - return array( - array('', '2y', 60), - array('crypto.driver.bcrypt_2y', '2y', 60), - array('crypto.driver.bcrypt', '2a', 60), - array('crypto.driver.salted_md5', 'H', 34), - ); + if (version_compare(PHP_VERSION, '5.3.7', '<')) + { + return array( + array('', '2a', 60), + array('crypto.driver.bcrypt_2y', '2a', 60), + array('crypto.driver.bcrypt', '2a', 60), + array('crypto.driver.salted_md5', 'H', 34), + ); + } + else + { + return array( + array('', '2y', 60), + array('crypto.driver.bcrypt_2y', '2y', 60), + array('crypto.driver.bcrypt', '2a', 60), + array('crypto.driver.salted_md5', 'H', 34), + ); + } } /**