mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2026-01-15 13:23:15 +01:00
NEW Add parameter replaceambiguouschars on getRandomPassword function
This commit is contained in:
@@ -260,17 +260,21 @@ class SecurityTest extends PHPUnit_Framework_TestCase
|
||||
{
|
||||
global $conf;
|
||||
|
||||
$genpass1=getRandomPassword(true); // Should be a string return by dol_hash (if no option set, will be md5)
|
||||
$genpass1=getRandomPassword(true); // Should be a string return by dol_hash (if no option set, will be md5)
|
||||
print __METHOD__." genpass1=".$genpass1."\n";
|
||||
$this->assertEquals(strlen($genpass1), 32);
|
||||
|
||||
$genpass1=getRandomPassword(true, array('I')); // Should be a string return by dol_hash (if no option set, will be md5)
|
||||
print __METHOD__." genpass1=".$genpass1."\n";
|
||||
$this->assertEquals(strlen($genpass1), 32);
|
||||
|
||||
$conf->global->USER_PASSWORD_GENERATED='None';
|
||||
$genpass2=getRandomPassword(false); // Should be an empty string
|
||||
$genpass2=getRandomPassword(false); // Should return an empty string
|
||||
print __METHOD__." genpass2=".$genpass2."\n";
|
||||
$this->assertEquals($genpass2, '');
|
||||
|
||||
$conf->global->USER_PASSWORD_GENERATED='Standard';
|
||||
$genpass3=getRandomPassword(false);
|
||||
$genpass3=getRandomPassword(false); // Should return a password of 8 chars
|
||||
print __METHOD__." genpass3=".$genpass3."\n";
|
||||
$this->assertEquals(strlen($genpass3), 8);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user