Add Mono-Alphabetic Cipher Test

Add Mono-Alphabetic Cipher Test
This commit is contained in:
YvonneChong18 2022-07-22 12:13:18 +08:00 committed by GitHub
parent f9fbd54474
commit 4eee60024a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -0,0 +1,20 @@
<?php
use PHPUnit\Framework\TestCase;
use function PHPUnit\Framework\assertEquals;
require_once __DIR__ . '/../app/monoAlphabeticCipher.php';
class MonoAlphabeticCipherTest extends TestCase
{
public function testLala(){
$alphabet = "abcdefghijklmnopqrstuvwxyz";
$key = "yhkqgvxfoluapwmtzecjdbsnri";
$text = "I love1234 GitHub";
$encryptedText = "O ambg XojFdh";
assertEquals(encrypt($key, $alphabet, $text), $encryptedText);
assertEquals(decrypt($key, $alphabet, $encryptedText), "I love GitHub");
}
}
?>