TheAlgorithms-PHP/tests/CiphersTest.php
2020-09-24 23:59:14 +03:30

19 lines
579 B
PHP
Executable File

<?php
use function PHPUnit\Framework\assertEquals;
use PHPUnit\Framework\TestCase;
require_once __DIR__ . '/../vendor/autoload.php';
require_once __DIR__ . '/../ciphers/caesarCipher.php';
class CiphersTest extends TestCase
{
public function testCaesarCipher()
{
assertEquals('Aopz pz h alza.', encrypt('This is a test.', 7));
assertEquals('Aopz pz h alza.', encrypt('This is a test.', 7 + 26));
assertEquals('This is a test.', decrypt('Aopz pz h alza.', 7));
assertEquals('This is a test.', decrypt('Aopz pz h alza.', 7 + 26));
}
}