mirror of
https://github.com/Combodo/iTop.git
synced 2026-04-24 02:58:43 +02:00
N°4459 Make sure that every test will pass even if the CI provides an invalid configuration file. Also allow encryption mecanism to be fully controlled by the tests
This commit is contained in:
@@ -129,6 +129,13 @@ abstract class ItopDataTestCase extends ItopTestCase
|
||||
{
|
||||
$this->CreateTestOrganization();
|
||||
}
|
||||
|
||||
$oConfig = MetaModel::GetConfig();
|
||||
if ($oConfig->GetEncryptionLibrary() != DEFAULT_ENCRYPTION_LIB
|
||||
&& $oConfig->GetEncryptionKey() == DEFAULT_ENCRYPTION_KEY) {
|
||||
// Config file is corrupted, let's fix it
|
||||
$oConfig->SetEncryptionKey("6eb9d9afa3ee0fbcebe622a33bf57aaeafb7c37998fd24c403c2522c2d60117f");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -14,14 +14,6 @@ class QueryBuilderExpressionsTest extends \Combodo\iTop\Test\UnitTest\ItopCustom
|
||||
return __DIR__."/Delta/all-attributes.xml";
|
||||
}
|
||||
|
||||
protected function setUp(): void
|
||||
{
|
||||
parent::setUp();
|
||||
|
||||
// Workaround to cope with inconsistent settings in itop-config files from the CI
|
||||
\AttributeEncryptedString::$sKey = "6eb9d9afa3ee0fbcebe622a33bf57aaeafb7c37998fd24c403c2522c2d60117f";
|
||||
}
|
||||
|
||||
public function testICanWriteAndReadAnyTypeOfAttribute()
|
||||
{
|
||||
$oTagA = \MetaModel::NewObject(\TagSetFieldData::GetTagDataClassName('TestObject', 'tagset'), [
|
||||
|
||||
Reference in New Issue
Block a user