mirror of
https://github.com/Combodo/iTop.git
synced 2026-02-12 23:14:18 +01:00
N°4058 - Setup failed when added an encrypted field due to default value NULL non SODIUM compatible (#754)
* N°4058 - Setup failed when added an encrypted field due to default value NULL non SODIUM compatible * N°4058 - Setup failed when added an encrypted field due to default value NULL non SODIUM compatible * change log level to warning
This commit is contained in:
36
tests/php-unit-tests/unitary-tests/core/SympleCryptTest.php
Normal file
36
tests/php-unit-tests/unitary-tests/core/SympleCryptTest.php
Normal file
@@ -0,0 +1,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"));
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user