tests erweitert

This commit is contained in:
Marcel Naeve 2024-04-19 22:53:12 +02:00
parent 2640b70e5e
commit 46689d085e
Signed by: manae
GPG Key ID: 3BB68BF9EA669981
1 changed files with 19 additions and 2 deletions

View File

@ -41,8 +41,25 @@ class test extends TestCase {
$this->assertEquals($data, $numberBaseCryptCollection->getPlainData()); $this->assertEquals($data, $numberBaseCryptCollection->getPlainData());
} }
// Full Circle simple data collection test // Full Circle simple data collection test with a single element
public function testFullCircleDataCollectionComplex() { public function testFullCircleDataCollectionComplexSingle() {
$data = [1337];
$numberBaseCryptCollection = new \NAE\Crypt\NumberBaseCryptCollection([
0, 1, 2, 3, 4, 5, 6, 7, 8, 9,
'a', 'b', 'c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z',
'A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z'
]);
foreach($data as $value) {
$numberBaseCryptCollection->addData($value);
}
$dataCollection = $numberBaseCryptCollection->render();
$digits = $numberBaseCryptCollection->getDigitList();
$reverse = $numberBaseCryptCollection->decryptComplex($dataCollection, $digits);
$this->assertEquals($data, $reverse);
}
// Full Circle simple data collection test with multiple elements
public function testFullCircleDataCollectionComplexMulti() {
$data = [1337,1338,11111,141415,12,5]; $data = [1337,1338,11111,141415,12,5];
$numberBaseCryptCollection = new \NAE\Crypt\NumberBaseCryptCollection([ $numberBaseCryptCollection = new \NAE\Crypt\NumberBaseCryptCollection([
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,