-
-
Notifications
You must be signed in to change notification settings - Fork 588
Expand file tree
/
Copy pathAtbashCipherTest.php
More file actions
25 lines (21 loc) · 725 Bytes
/
Copy pathAtbashCipherTest.php
File metadata and controls
25 lines (21 loc) · 725 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
<?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);
}
}