Add encryption handling and session flags management.
This commit is contained in:
parent
1d452bc71b
commit
86435a3d0b
13 changed files with 857 additions and 134 deletions
22
tests/Socialbox/Classes/SecuredPasswordTest.php
Normal file
22
tests/Socialbox/Classes/SecuredPasswordTest.php
Normal file
|
@ -0,0 +1,22 @@
|
|||
<?php
|
||||
|
||||
namespace Socialbox\Classes;
|
||||
|
||||
use PHPUnit\Framework\TestCase;
|
||||
use Socialbox\Managers\EncryptionRecordsManager;
|
||||
|
||||
class SecuredPasswordTest extends TestCase
|
||||
{
|
||||
public function testVerifyPassword()
|
||||
{
|
||||
print("Getting random encryption record\n");
|
||||
$encryptionRecord = EncryptionRecordsManager::getRandomRecord();
|
||||
var_dump($encryptionRecord);
|
||||
|
||||
print("Securing password\n");
|
||||
$securedPassword = SecuredPassword::securePassword('123-123-123', 'password!', $encryptionRecord);
|
||||
|
||||
print("Verifying password\n");
|
||||
$this->assertTrue(SecuredPassword::verifyPassword('password!', $securedPassword, EncryptionRecordsManager::getAllRecords()));
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue