mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-07 10:41:40 +09:00
Add more algorithms to unit test
This commit is contained in:
parent
69c5147888
commit
de0d49b9f3
1 changed files with 7 additions and 1 deletions
|
|
@ -69,12 +69,18 @@ class PasswordTest extends \Codeception\TestCase\Test
|
|||
$this->assertEquals(60, strlen($hash));
|
||||
$this->assertTrue(Rhymix\Framework\Password::checkPassword($password, $hash, $algos));
|
||||
|
||||
$algos = array('pbkdf2');
|
||||
$algos = array('sha384', 'pbkdf2');
|
||||
$hash = Rhymix\Framework\Password::hashPassword($password, $algos);
|
||||
$this->assertRegExp('/^(sha256|sha512):[0-9]+:/', $hash);
|
||||
$this->assertEquals(60, strlen($hash));
|
||||
$this->assertTrue(Rhymix\Framework\Password::checkPassword($password, $hash, $algos));
|
||||
|
||||
$algos = array('sha1', 'portable');
|
||||
$hash = Rhymix\Framework\Password::hashPassword($password, $algos);
|
||||
$this->assertRegExp('/^\$P\$/', $hash);
|
||||
$this->assertEquals(34, strlen($hash));
|
||||
$this->assertTrue(Rhymix\Framework\Password::checkPassword($password, $hash, $algos));
|
||||
|
||||
foreach (array('drupal', 'joomla', 'kimsqrb', 'mysql_old_password', 'mysql_new_password', 'mssql_pwdencrypt') as $algo)
|
||||
{
|
||||
$hash = Rhymix\Framework\Password::hashPassword($password, $algo);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue