mirror of
https://github.com/PrivateBin/PrivateBin.git
synced 2024-03-22 13:10:41 +08:00
only mock mcrypt if it isn't installed
This commit is contained in:
parent
67133ec090
commit
1158c81259
|
@ -37,6 +37,8 @@ class serversaltTest extends PHPUnit_Framework_TestCase
|
|||
$salt = serversalt::get();
|
||||
|
||||
// mcrypt mock
|
||||
if (!function_exists('mcrypt_create_iv'))
|
||||
{
|
||||
if (!defined('MCRYPT_DEV_URANDOM')) define('MCRYPT_DEV_URANDOM', 1);
|
||||
function mcrypt_create_iv($int, $flag)
|
||||
{
|
||||
|
@ -52,6 +54,7 @@ class serversaltTest extends PHPUnit_Framework_TestCase
|
|||
return hex2bin($randomSalt);
|
||||
}
|
||||
$this->assertNotEquals($salt, serversalt::generate());
|
||||
}
|
||||
|
||||
// try setting a different path and resetting it
|
||||
serversalt::setPath($this->_otherPath);
|
||||
|
|
Loading…
Reference in New Issue
Block a user