[feature/passwords] Fix tests on PHP versions < 5.3.7

PHPBB3-11610
This commit is contained in:
Marc Alexander 2013-06-29 00:04:02 +02:00
parent cfbd858bd7
commit ddc207fae8

View file

@ -128,24 +128,44 @@ class phpbb_crypto_manager_test extends PHPUnit_Framework_TestCase
public function test_combined_hash_data() public function test_combined_hash_data()
{ {
return array( if (version_compare(PHP_VERSION, '5.3.7', '<'))
array( {
'crypto.driver.salted_md5', return array(
array('crypto.driver.bcrypt_2y'), array(
), 'crypto.driver.salted_md5',
array( array('crypto.driver.bcrypt'),
'crypto.driver.salted_md5', ),
array('crypto.driver.bcrypt'), array(
), 'crypto.driver.phpass',
array( array('crypto.driver.salted_md5'),
'crypto.driver.phpass', ),
array('crypto.driver.salted_md5'), array(
), 'crypto.driver.salted_md5',
array( array('crypto.driver.phpass', 'crypto.driver.bcrypt'),
'crypto.driver.salted_md5', ),
array('crypto.driver.bcrypt_2y', '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'),
),
);
}
} }
/** /**