-
Notifications
You must be signed in to change notification settings - Fork 283
Expand file tree
/
Copy pathSympleCryptTest.php
More file actions
36 lines (30 loc) · 874 Bytes
/
SympleCryptTest.php
File metadata and controls
36 lines (30 loc) · 874 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
<?php
/*!
* @copyright Copyright (C) 2010-2024 Combodo SAS
* @license http://opensource.org/licenses/AGPL-3.0
*/
namespace Combodo\iTop\Test\UnitTest\Core;
use Combodo\iTop\Test\UnitTest\ItopDataTestCase;
use SodiumException;
/**
* Tests of the ormPassword class
*/
class SympleCryptTest extends ItopDataTestCase
{
public function testDecryptWithNullValue()
{
$oSimpleCrypt = new \SimpleCrypt("Sodium");
$this->assertEquals(null, $oSimpleCrypt->Decrypt("dd", null));
}
public function testDecryptWithEmptyValue()
{
$oSimpleCrypt = new \SimpleCrypt("Sodium");
$this->assertEquals('', $oSimpleCrypt->Decrypt("dd", ""));
}
public function testDecrypNonDecryptableValue()
{
$this->expectException(SodiumException::class);
$oSimpleCrypt = new \SimpleCrypt("Sodium");
$this->assertEquals('', $oSimpleCrypt->Decrypt("dd", "gabuzomeu"));
}
}