mirror of
https://github.com/TheAlgorithms/PHP.git
synced 2025-07-09 11:13:50 +02:00
26 lines
725 B
PHP
26 lines
725 B
PHP
<?php
|
|
|
|
use PHPUnit\Framework\TestCase;
|
|
|
|
require_once __DIR__ . '/../../vendor/autoload.php';
|
|
require_once __DIR__ . '/../../Ciphers/AtbashCipher.php';
|
|
|
|
class AtbashCipherTest extends TestCase
|
|
{
|
|
public function testEncryptionAndDecryption()
|
|
{
|
|
$plainText = "HELLO";
|
|
$encryptedText = atbash_encrypt($plainText);
|
|
$decryptedText = atbash_decrypt($encryptedText);
|
|
$this->assertEquals($plainText, $decryptedText);
|
|
}
|
|
|
|
public function testWithNonAlphabetCharacters()
|
|
{
|
|
$plainText = "HELLO, WORLD!";
|
|
$encryptedText = atbash_encrypt($plainText);
|
|
$decryptedText = atbash_decrypt($encryptedText);
|
|
$this->assertEquals($plainText, $decryptedText);
|
|
}
|
|
}
|