mirror of
https://github.com/Combodo/iTop.git
synced 2026-05-30 12:42:16 +02:00
✅ N°9169 - Adapt ITSM designer connector to the new setup (FIX some unit tests)
This commit is contained in:
@@ -36,7 +36,6 @@ class TriggerOnAttachmentDelete extends TriggerOnObject
|
||||
MetaModel::Init_InheritAttributes();
|
||||
MetaModel::Init_AddAttribute(new AttributeBoolean("file_in_email", ["sql" => 'file_in_email', "is_null_allowed" => false, "default_value" => 'true', "allowed_values" => null, "depends_on" => [], "always_load_in_tables" => false]));
|
||||
|
||||
|
||||
// Display lists
|
||||
MetaModel::Init_SetZListItems('details', ['description', 'context', 'filter', 'action_list', 'target_class','file_in_email']); // Attributes to be displayed for the complete details
|
||||
MetaModel::Init_SetZListItems('list', ['finalclass', 'target_class']); // Attributes to be displayed for a list
|
||||
|
||||
@@ -22,8 +22,6 @@ namespace Combodo\iTop\Test\UnitTest\Core;
|
||||
|
||||
use Attachment;
|
||||
use AttributeDateTime;
|
||||
use Combodo\iTop\Application\WebPage\iTopWebPage;
|
||||
use Combodo\iTop\Application\WebPage\WebPage;
|
||||
use Combodo\iTop\Service\Events\EventData;
|
||||
use Combodo\iTop\Test\UnitTest\ItopDataTestCase;
|
||||
use CoreException;
|
||||
@@ -39,7 +37,6 @@ use Team;
|
||||
use User;
|
||||
use UserRequest;
|
||||
use UserRights;
|
||||
use utils;
|
||||
|
||||
/**
|
||||
* @group specificOrgInSampleData
|
||||
@@ -524,7 +521,7 @@ class DBObjectTest extends ItopDataTestCase
|
||||
|
||||
$oAdminUser = MetaModel::GetObjectByName(User::class, 'admin', false);
|
||||
if (is_null($oAdminUser)) {
|
||||
$oAdminUser = $this->CreateUser('admin', 1);
|
||||
$oAdminUser = $this->CreateUser('admin', 1, 'Zydw&%&h25F4');
|
||||
}
|
||||
|
||||
/** @var Person $oPersonObject */
|
||||
|
||||
@@ -268,7 +268,7 @@ class UserLocalTest extends ItopDataTestCase
|
||||
$this->assertEquals($oBefore, $oUserLocal->Get('password_renewed_date'));
|
||||
|
||||
//INSERT
|
||||
$oUserLocal->Set('password', 'fooBar1???');
|
||||
$oUserLocal->Set('password', 'Zydw&%&h25F4');
|
||||
$oUserLocal->DBWrite();
|
||||
$this->assertEquals($oNow, $oUserLocal->Get('password_renewed_date'), 'INSERT sets the "password_renewed_date" to the current date');
|
||||
|
||||
@@ -280,13 +280,13 @@ class UserLocalTest extends ItopDataTestCase
|
||||
|
||||
//UPDATE password
|
||||
$oUserLocal = MetaModel::GetObject(UserLocal::class, $oUserLocal->GetKey());
|
||||
$oUserLocal->Set('password', 'fooBar1???1');
|
||||
$oUserLocal->Set('password', 'Zydw&%&h25F5');
|
||||
$oUserLocal->DBWrite();
|
||||
$this->assertEquals($oExpectedAfter, $oUserLocal->Get('password_renewed_date'), 'UPDATE "password" fields trigger automatic change of the "password_renewed_date" field');
|
||||
|
||||
//UPDATE both password & password_renewed_date
|
||||
$oUserLocal = MetaModel::GetObject(UserLocal::class, $oUserLocal->GetKey());
|
||||
$oUserLocal->Set('password', 'fooBar1???2');
|
||||
$oUserLocal->Set('password', 'Zydw&%&h25F6');
|
||||
$oUserLocal->Set('password_renewed_date', $oBefore);
|
||||
$oUserLocal->DBWrite();
|
||||
$this->assertEquals($oBefore, $oUserLocal->Get('password_renewed_date'), 'UPDATE can target and change both "password" and "password_renewed_date"');
|
||||
@@ -337,7 +337,7 @@ class UserLocalTest extends ItopDataTestCase
|
||||
$this->assertEquals($oBefore, $oUserLocal->Get('password_renewed_date'));
|
||||
|
||||
//INSERT
|
||||
$oUserLocal->Set('password', 'fooBar1???');
|
||||
$oUserLocal->Set('password', 'Zydw&%&h25F4');
|
||||
$oUserLocal->DBWrite();
|
||||
$this->assertEquals($oNow, $oUserLocal->Get('password_renewed_date'), 'INSERT sets the "password_renewed_date" to the current date');
|
||||
|
||||
|
||||
Reference in New Issue
Block a user