mirror of
https://github.com/PHPOffice/PhpSpreadsheet.git
synced 2026-09-12 11:06:28 +00:00
ec4098c8fd
While we might never be able to have 100% of our code strict, we can at the very least do it for all of our tests. This ensures that our tests are using our API with the types as intended by the test author, and not silently be cast to what our API requires.
24 lines
701 B
PHP
24 lines
701 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace PhpOffice\PhpSpreadsheetTests\Reader\Xls;
|
|
|
|
use PhpOffice\PhpSpreadsheet\Reader\Xls\RC4;
|
|
use PHPUnit\Framework\TestCase;
|
|
|
|
class Rc4Test extends TestCase
|
|
{
|
|
public function testRc4(): void
|
|
{
|
|
// following result confirmed at:
|
|
// https://cryptii.com/pipes/rc4-encryption
|
|
$key = "\x63\x72\x79\x70\x74\x69\x69";
|
|
$string = 'The quick brown fox jumps over the lazy dog.';
|
|
$rc4 = new RC4($key);
|
|
$result = bin2hex($rc4->RC4($string));
|
|
$expectedResult = '2ac2fecdd8fbb84638e3a4820eb205cc8e29c28b9d5d6b2ef974f311964971c90e8b9ca16467ef2dc6fc3520';
|
|
self::assertSame($expectedResult, $result);
|
|
}
|
|
}
|