22 lines
546 B
PHP
22 lines
546 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace Domovoy\Tests\Security;
|
|
|
|
use Domovoy\Services\Security\CredentialVault;
|
|
use PHPUnit\Framework\TestCase;
|
|
|
|
final class CredentialVaultTest extends TestCase
|
|
{
|
|
public function testEncryptsAndDecryptsSecretWithoutStoringPlaintext(): void
|
|
{
|
|
$vault = new CredentialVault('test-key-material');
|
|
|
|
$encrypted = $vault->encrypt('secret-password');
|
|
|
|
self::assertNotSame('secret-password', $encrypted);
|
|
self::assertSame('secret-password', $vault->decrypt($encrypted));
|
|
}
|
|
}
|