Drop redundant crypto gateway tests
This commit is contained in:
@@ -1,34 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace MintyPHP\Tests\Service\Auth;
|
||||
|
||||
use MintyPHP\Service\Auth\AuthCryptoGateway;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
|
||||
final class AuthCryptoGatewayTest extends TestCase
|
||||
{
|
||||
private AuthCryptoGateway $gateway;
|
||||
|
||||
protected function setUp(): void
|
||||
{
|
||||
if (!defined('APP_CRYPTO_KEY')) {
|
||||
define('APP_CRYPTO_KEY', str_repeat('ab', 32));
|
||||
}
|
||||
|
||||
$this->gateway = new AuthCryptoGateway();
|
||||
}
|
||||
|
||||
public function testIsConfiguredReturnsTrueWhenKeyIsSet(): void
|
||||
{
|
||||
self::assertTrue($this->gateway->isConfigured());
|
||||
}
|
||||
|
||||
public function testEncryptDecryptDelegatesToCrypto(): void
|
||||
{
|
||||
$plaintext = 'auth-secret';
|
||||
$encrypted = $this->gateway->encryptString($plaintext);
|
||||
|
||||
self::assertNotSame($plaintext, $encrypted);
|
||||
self::assertSame($plaintext, $this->gateway->decryptString($encrypted));
|
||||
}
|
||||
}
|
||||
@@ -1,32 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace MintyPHP\Tests\Service\Settings;
|
||||
|
||||
use MintyPHP\Service\Settings\SettingsCryptoGateway;
|
||||
use MintyPHP\Service\Settings\SettingsCryptoGatewayInterface;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
|
||||
final class SettingsCryptoGatewayTest extends TestCase
|
||||
{
|
||||
protected function setUp(): void
|
||||
{
|
||||
if (!defined('APP_CRYPTO_KEY')) {
|
||||
define('APP_CRYPTO_KEY', str_repeat('ab', 32));
|
||||
}
|
||||
}
|
||||
|
||||
public function testImplementsSettingsCryptoGatewayInterface(): void
|
||||
{
|
||||
self::assertInstanceOf(SettingsCryptoGatewayInterface::class, new SettingsCryptoGateway());
|
||||
}
|
||||
|
||||
public function testEncryptDecryptDelegatesToCrypto(): void
|
||||
{
|
||||
$gateway = new SettingsCryptoGateway();
|
||||
$plaintext = 'settings-secret';
|
||||
$encrypted = $gateway->encryptString($plaintext);
|
||||
|
||||
self::assertNotSame($plaintext, $encrypted);
|
||||
self::assertSame($plaintext, $gateway->decryptString($encrypted));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user