mirror of
https://github.com/TheAlgorithms/PHP.git
synced 2025-01-17 23:28:14 +01:00
20 lines
615 B
PHP
20 lines
615 B
PHP
<?php
|
|
|
|
use PHPUnit\Framework\TestCase;
|
|
|
|
require_once __DIR__ . '/../../vendor/autoload.php';
|
|
require_once __DIR__ . '/../../Ciphers/MonoAlphabeticCipher.php';
|
|
|
|
class MonoAlphabeticCipherTest extends TestCase
|
|
{
|
|
public function testMonoAlphabeticCipher()
|
|
{
|
|
$alphabet = "abcdefghijklmnopqrstuvwxyz";
|
|
$key = "yhkqgvxfoluapwmtzecjdbsnri";
|
|
$text = "I love1234 GitHub";
|
|
$encryptedText = "O ambg XojFdh";
|
|
$this->assertEquals(maEncrypt($key, $alphabet, $text), $encryptedText);
|
|
$this->assertEquals(maDecrypt($key, $alphabet, $encryptedText), "I love GitHub");
|
|
}
|
|
}
|