Merge remote-tracking branch 'origin/support/3.2' into develop

This commit is contained in:
Eric Espie
2024-04-24 16:11:58 +02:00
27 changed files with 160 additions and 49 deletions

View File

@@ -566,7 +566,7 @@ EOF;
{
if (is_object($aObjects[$sAlias]))
{
$sHilightClass = $aObjects[$sAlias]->GetHilightClass();
$sHilightClass = MetaModel::GetHilightClass($sClassName, $aObjects[$sAlias]);
if ($sHilightClass != '')
{
$aRow['@class'] = $sHilightClass;

View File

@@ -52,9 +52,9 @@ abstract class Action extends cmdbAbstractObject
"category" => "grant_by_profile,core/cmdb",
"key_type" => "autoincrement",
"name_attcode" => "name",
"complementary_name_attcode" => array('finalclass', 'description'),
"complementary_name_attcode" => ['finalclass', 'description'],
"state_attcode" => "status",
"reconc_keys" => array('name'),
"reconc_keys" => ['name'],
"db_table" => "priv_action",
"db_key_field" => "id",
"db_finalclass_field" => "realclass",
@@ -287,8 +287,9 @@ abstract class ActionNotification extends Action
"category" => "grant_by_profile,core/cmdb",
"key_type" => "autoincrement",
"name_attcode" => "name",
"complementary_name_attcode" => ['finalclass', 'description'],
"state_attcode" => "",
"reconc_keys" => array('name'),
"reconc_keys" => ['name'],
"db_table" => "priv_action_notification",
"db_key_field" => "id",
"db_finalclass_field" => "",

View File

@@ -560,6 +560,14 @@ class Config
'source_of_value' => '',
'show_in_conf_sample' => true,
],
'list.highlight_abstract_class' => [
'type' => 'bool',
'description' => 'Compute highlight row colors for lists of abstract objects. Mind that setting this to true has a negative impact on performances.',
'default' => false,
'value' => false,
'source_of_value' => '',
'show_in_conf_sample' => false,
],
'tag_set_item_separator' => [
'type' => 'string',
'description' => 'Tag set from string: tag label separator',

View File

@@ -108,6 +108,10 @@
<attributes>
<attribute id="name"/>
</attributes>
<complementary_attributes>
<attribute id="finalclass"/>
<attribute id="description"/>
</complementary_attributes>
</naming>
<style>
<icon>../../images/icons/icons8-notification.svg</icon>
@@ -333,6 +337,11 @@
<attribute id="title"/>
</attributes>
</naming>
<order>
<columns>
<column id="date" ascending="false" />
</columns>
</order>
</properties>
<fields>
<field id="title" xsi:type="AttributeString">
@@ -435,6 +444,41 @@
</item>
</items>
</summary>
<list>
<items>
<item id="date">
<rank>10</rank>
</item>
<item id="contact_id">
<rank>20</rank>
</item>
<item id="message">
<rank>30</rank>
</item>
<item id="read">
<rank>40</rank>
</item>
<item id="read_date">
<rank>50</rank>
</item>
</items>
</list>
<default_search>
<items>
<item id="action_id">
<rank>10</rank>
</item>
<item id="trigger_id">
<rank>20</rank>
</item>
<item id="date">
<rank>30</rank>
</item>
<item id="contact_id">
<rank>40</rank>
</item>
</items>
</default_search>
</presentation>
<methods/>
</class>

View File

@@ -129,6 +129,7 @@ class HTMLBulkExport extends TabularBulkExport
$this->OptimizeColumnLoad($oSet);
$sFirstAlias = $this->oSearch->GetClassAlias();
$sClass = $this->oSearch->GetClass();
$iCount = 0;
$sData = '';
@@ -141,7 +142,7 @@ class HTMLBulkExport extends TabularBulkExport
$sHilightClass = '';
if ($oMainObj)
{
$sHilightClass = $aRow[$sFirstAlias]->GetHilightClass();
$sHilightClass = MetaModel::GetHilightClass($sClass, $aRow[$sFirstAlias]);
}
if ($sHilightClass != '')
{

View File

@@ -3697,6 +3697,27 @@ abstract class MetaModel
self::$m_aHighlightScales[$sTargetClass] = $aHighlightScale;
}
/**
* Get the HTML class to apply to the object in the datatables
*
* @param string $sClass requested for the list (can be abstract)
* @param \DBObject $oObject the object to display
*
* @return string the class to apply to the object
* @throws \ArchivedObjectException
* @throws \CoreException
*
* @since 3.2.0
*/
final public static function GetHilightClass(string $sClass, DBObject $oObject): string
{
if (self::IsAbstract($sClass) && self::GetConfig()->Get('list.highlight_abstract_class') === false) {
return '';
}
return $oObject->GetHilightClass();
}
/**
* @param string $sTargetClass
*

View File

@@ -36,9 +36,9 @@ abstract class Trigger extends cmdbAbstractObject
"category" => "grant_by_profile,core/cmdb",
"key_type" => "autoincrement",
"name_attcode" => "description",
"complementary_name_attcode" => array('finalclass', 'complement'),
"complementary_name_attcode" => ['finalclass', 'complement'],
"state_attcode" => "",
"reconc_keys" => array('description'),
"reconc_keys" => ['description'],
"db_table" => "priv_trigger",
"db_key_field" => "id",
"db_finalclass_field" => "realclass",
@@ -173,8 +173,9 @@ abstract class TriggerOnObject extends Trigger
"category" => "grant_by_profile,core/cmdb",
"key_type" => "autoincrement",
"name_attcode" => "description",
"complementary_name_attcode" => ['finalclass', 'complement'],
"state_attcode" => "",
"reconc_keys" => array('description'),
"reconc_keys" => ['description'],
"db_table" => "priv_trigger_onobject",
"db_key_field" => "id",
"db_finalclass_field" => "",
@@ -375,8 +376,9 @@ class TriggerOnPortalUpdate extends TriggerOnObject
"category" => "grant_by_profile,core/cmdb,application",
"key_type" => "autoincrement",
"name_attcode" => "description",
"complementary_name_attcode" => ['finalclass', 'complement'],
"state_attcode" => "",
"reconc_keys" => array('description'),
"reconc_keys" => ['description'],
"db_table" => "priv_trigger_onportalupdate",
"db_key_field" => "id",
"db_finalclass_field" => "",
@@ -407,8 +409,9 @@ abstract class TriggerOnStateChange extends TriggerOnObject
"category" => "grant_by_profile,core/cmdb",
"key_type" => "autoincrement",
"name_attcode" => "description",
"complementary_name_attcode" => ['finalclass', 'complement'],
"state_attcode" => "",
"reconc_keys" => array('description'),
"reconc_keys" => ['description'],
"db_table" => "priv_trigger_onstatechange",
"db_key_field" => "id",
"db_finalclass_field" => "",
@@ -441,8 +444,9 @@ class TriggerOnStateEnter extends TriggerOnStateChange
"category" => "grant_by_profile,core/cmdb,application",
"key_type" => "autoincrement",
"name_attcode" => "description",
"complementary_name_attcode" => ['finalclass', 'complement'],
"state_attcode" => "",
"reconc_keys" => array('description'),
"reconc_keys" => ['description'],
"db_table" => "priv_trigger_onstateenter",
"db_key_field" => "id",
"db_finalclass_field" => "",
@@ -474,8 +478,9 @@ class TriggerOnStateLeave extends TriggerOnStateChange
"category" => "grant_by_profile,core/cmdb,application",
"key_type" => "autoincrement",
"name_attcode" => "description",
"complementary_name_attcode" => ['finalclass', 'complement'],
"state_attcode" => "",
"reconc_keys" => array('description'),
"reconc_keys" => ['description'],
"db_table" => "priv_trigger_onstateleave",
"db_key_field" => "id",
"db_finalclass_field" => "",
@@ -507,8 +512,9 @@ class TriggerOnObjectCreate extends TriggerOnObject
"category" => "grant_by_profile,core/cmdb,application",
"key_type" => "autoincrement",
"name_attcode" => "description",
"complementary_name_attcode" => ['finalclass', 'complement'],
"state_attcode" => "",
"reconc_keys" => array('description'),
"reconc_keys" => ['description'],
"db_table" => "priv_trigger_onobjcreate",
"db_key_field" => "id",
"db_finalclass_field" => "",
@@ -540,8 +546,9 @@ class TriggerOnObjectDelete extends TriggerOnObject
"category" => "grant_by_profile,core/cmdb,application",
"key_type" => "autoincrement",
"name_attcode" => "description",
"complementary_name_attcode" => ['finalclass', 'complement'],
"state_attcode" => "",
"reconc_keys" => array('description'),
"reconc_keys" => ['description'],
"db_table" => "priv_trigger_onobjdelete",
"db_key_field" => "id",
"db_finalclass_field" => "",
@@ -574,8 +581,9 @@ class TriggerOnObjectUpdate extends TriggerOnObject
"category" => "grant_by_profile,core/cmdb,application",
"key_type" => "autoincrement",
"name_attcode" => "description",
"complementary_name_attcode" => ['finalclass', 'complement'],
"state_attcode" => "",
"reconc_keys" => array('description'),
"reconc_keys" => ['description'],
"db_table" => "priv_trigger_onobjupdate",
"db_key_field" => "id",
"db_finalclass_field" => "",
@@ -669,8 +677,9 @@ class TriggerOnObjectMention extends TriggerOnObject
"category" => "grant_by_profile,core/cmdb,application",
"key_type" => "autoincrement",
"name_attcode" => "description",
"complementary_name_attcode" => ['finalclass', 'complement'],
"state_attcode" => "",
"reconc_keys" => array('description'),
"reconc_keys" => ['description'],
"db_table" => "priv_trigger_onobjmention",
"db_key_field" => "id",
"db_finalclass_field" => "",
@@ -749,8 +758,9 @@ class TriggerOnAttributeBlobDownload extends TriggerOnObject
"category" => "grant_by_profile,core/cmdb,application",
"key_type" => "autoincrement",
"name_attcode" => "description",
"complementary_name_attcode" => ['finalclass', 'complement'],
"state_attcode" => "",
"reconc_keys" => array('description'),
"reconc_keys" => ['description'],
"db_table" => "priv_trigger_onattblobdownload",
"db_key_field" => "id",
"db_finalclass_field" => "",
@@ -827,8 +837,9 @@ class TriggerOnThresholdReached extends TriggerOnObject
"category" => "grant_by_profile,core/cmdb,application",
"key_type" => "autoincrement",
"name_attcode" => "description",
"complementary_name_attcode" => ['finalclass', 'complement'],
"state_attcode" => "",
"reconc_keys" => array('description'),
"reconc_keys" => ['description'],
"db_table" => "priv_trigger_threshold",
"db_key_field" => "id",
"db_finalclass_field" => "",

View File

@@ -385,6 +385,12 @@ abstract class User extends cmdbAbstractObject
/** @var \DBObjectSet $oSet */
$oSet = $this->Get('profile_list');
if ($oSet->Count() == 0) {
if (ContextTag::Check(ContextTag::TAG_SETUP)) {
// During setup, if a profile is no more part of iTop, it will be deleted
// But if it is the only profile assigned to a user, we don't want this to stop the setup
SetupLog::Warning("The user with id: ".$this->GetKey()." is no more usable as its last profile was removed during setup");
return;
}
$this->m_aCheckIssues[] = Dict::S('Class:User/Error:AtLeastOneProfileIsNeeded');
}

View File

@@ -771,8 +771,9 @@ class TriggerOnAttachmentDownload extends TriggerOnAttributeBlobDownload
"category" => "grant_by_profile,core/cmdb,application",
"key_type" => "autoincrement",
"name_attcode" => "description",
"complementary_name_attcode" => ['finalclass', 'complement'],
"state_attcode" => "",
"reconc_keys" => array('description'),
"reconc_keys" => ['description'],
"db_table" => "priv_trigger_onattdownload",
"db_key_field" => "id",
"db_finalclass_field" => "",

View File

@@ -1021,6 +1021,7 @@ Dict::Add('CS CZ', 'Czech', 'Čeština', array(
<ol>
<li>Sending an email message: Such actions also define the template to be used for sending the email as well as the other parameters of the message like the recipients, importance, etc.<br />
Speciální stránka <a href="../setup/email.test.php" target="_blank">email.test.php</a> je dostupná pro testování a řešení problémů s configurací PHP mailu.</li>
<li>Sending a newsroom message: Display a news to user directly in the application through the newsroom (bell icon on the left menu)</li>
<li>Outgoing webhooks: Allow integration with a third-party application by sending structured data to a defined URL.</li>
</ol>
</p>

View File

@@ -1011,6 +1011,7 @@ Dict::Add('DA DA', 'Danish', 'Dansk', array(
<ol>
<li>Sending an email message: Such actions also define the template to be used for sending the email as well as the other parameters of the message like the recipients, importance, etc.<br />
En speciel side: <a href="../setup/email.test.php" target="_blank">email.test.php</a> er til rådighed for test og problemløsning af PHP mail konfigurationen.</li>
<li>Sending a newsroom message: Display a news to user directly in the application through the newsroom (bell icon on the left menu)</li>
<li>Outgoing webhooks: Allow integration with a third-party application by sending structured data to a defined URL.</li>
</ol>
</p>

View File

@@ -1009,6 +1009,7 @@ Dict::Add('DE DE', 'German', 'Deutsch', array(
<ol>
<li>Senden einer E-Mail: Solche Aktionen definieren die verwendete Vorlage sowie andere Parameter der Nachricht wie Empfänger, Wichtigkeit, usw.<br />
Eine spezielle Seite: <a href="../setup/email.test.php" target="_blank">email.test.php</a> steht zum Testen und zur Fehlerbehebung Ihrer PHP-Mailkonfiguration bereit.</li>
<li>Sending a newsroom message: Display a news to user directly in the application through the newsroom (bell icon on the left menu)</li>
<li>Ausgehende webhooks: Erlaubt die Integration mit einer externen Anwendung indem strukturierte Daten an eine definierte URL gesendet werden.</li>
</ol>
</p>

View File

@@ -1061,6 +1061,7 @@ Dict::Add('EN US', 'English', 'English', array(
<ol>
<li>Sending an email message: Such actions also define the template to be used for sending the email as well as the other parameters of the message like the recipients, importance, etc.<br />
A special page: <a href="../setup/email.test.php" target="_blank">email.test.php</a> is available for testing and troubleshooting your PHP mail configuration.</li>
<li>Sending a newsroom message: Display a news to user directly in the application through the newsroom (bell icon on the left menu)</li>
<li>Outgoing webhooks: Allow integration with a third-party application by sending structured data to a defined URL.</li>
</ol>
</p>

View File

@@ -1028,6 +1028,7 @@ Dict::Add('ES CR', 'Spanish', 'Español, Castellano', array(
<ol>
<li>Enviar un mensaje de correo: Dichas acciones también definen la plantilla que se utilizará para enviar el correo electrónico, así como los demás parámetros del mensaje, como los destinatarios, la importancia, etc.<br />
Una página especial: <a href="../setup/email.test.php" target="_blank">email.test.php</a> está disponible para probar y diagnosticar su configuración de correo de PHP.</li>
<li>Sending a newsroom message: Display a news to user directly in the application through the newsroom (bell icon on the left menu)</li>
<li>Webhooks de Salida: permite la integración con una aplicación de terceros mediante el envío de datos estructurados a una URL definida.</li>
</ol>
</p>

View File

@@ -1024,6 +1024,7 @@ Nous espérons que vous aimerez cette version autant que nous avons eu du plaisi
<ol>
<li>L\'envoi de mél : Les actions de type mél définissent le modèle du message ainsi que les autres paramètres (destinataires, importance, etc.).<br />
Une page spéciale : <a href="../setup/email.test.php" target="_blank">email.test.php</a> permet de tester votre configuration mail PHP.</li>
<li>L\'envoi de message newsroom : Les actions de type newsroom permettent d\'afficher une news à l\'utilisateur directement dans l\'application à travers la newsroom (icône de cloche dans le menu de gauche)</li>
<li>Les webhooks sortants : Les actions de type webhooks permettent l\'intégration avec une application tierce en transmettant des données structurées à une URL définie.</li>
</ol>
</p>

View File

@@ -1011,6 +1011,7 @@ Dict::Add('HU HU', 'Hungarian', 'Magyar', array(
<i><b>A műveletek</b></i> meghatározzák a kiváltó programok végrehajtásakor végrehajtandó műveleteket. Egyelőre csak kétféle művelet létezik:
<ol>
<li>Email üzenet küldése: Az ilyen műveletek meghatározzák az email küldéséhez használandó sablont, valamint az üzenet egyéb paramétereit, mint például a címzettek, fontosság stb.<br />
<li>Sending a newsroom message: Display a news to user directly in the application through the newsroom (bell icon on the left menu)</li>
Egy speciális oldalon: <a href="../setup/email.test.php" target="_blank">email.test.php</a> oldalon keresztül a PHP mail konfiguráció tesztelhető.</li>
<li>Kimenő webhook-ok: Lehetővé teszik a harmadik fél alkalmazásával való integrációt strukturált adatok küldésével egy meghatározott URL-címen keresztül.</li>
</ol>

View File

@@ -1028,6 +1028,7 @@ Dict::Add('IT IT', 'Italian', 'Italiano', array(
<ol>
<li>Sending an email message: Such actions also define the template to be used for sending the email as well as the other parameters of the message like the recipients, importance, etc.<br />
Una Pagina speciale: <a href="../setup/email.test.php" target="_blank">email.test.php</a> è disponibile per il testing e la risoluzione dei problemi di configurazione PHP mail.</li>
<li>Sending a newsroom message: Display a news to user directly in the application through the newsroom (bell icon on the left menu)</li>
<li>Outgoing webhooks: Allow integration with a third-party application by sending structured data to a defined URL.</li>
</ol>
</p>

View File

@@ -1011,6 +1011,7 @@ Dict::Add('JA JP', 'Japanese', '日本語', array(
<ol>
<li>Sending an email message: Such actions also define the template to be used for sending the email as well as the other parameters of the message like the recipients, importance, etc.<br />
特別なページ: <a href="../setup/email.test.php" target="_blank">email.test.php</a> は、PHPのメール設定をテストしたりトラブルシュートするのに利用可能であす。</li>
<li>Sending a newsroom message: Display a news to user directly in the application through the newsroom (bell icon on the left menu)</li>
<li>Outgoing webhooks: Allow integration with a third-party application by sending structured data to a defined URL.</li>
</ol>
</p>

View File

@@ -1025,6 +1025,7 @@ Dict::Add('NL NL', 'Dutch', 'Nederlands', array(
<ol>
<li>Stuur een e-mail: Bij deze acties definieer je een sjabloon voor het bericht en ook parameters zoals ontvanger(s), prioriteit, enz.<br />
Een <a href="../setup/email.test.php" target="_blank">speciale testpagina (email.test.php)</a> is beschikbaar voor het testen en oplossen van eventuele problemen met jouw PHP e-mailconfiguratie.</li>
<li>Sending a newsroom message: Display a news to user directly in the application through the newsroom (bell icon on the left menu)</li>
<li>Webhooks: Staat toe om te integreren met toepassingen van derde partijen, door gestructureerde data te sturen naar een URL.</li>
</ol>
</p>

View File

@@ -1022,6 +1022,7 @@ Dict::Add('PL PL', 'Polish', 'Polski', array(
<ol>
<li>Sending an email message: Such actions also define the template to be used for sending the email as well as the other parameters of the message like the recipients, importance, etc.<br />
Specjalna strona: <a href="../setup/email.test.php" target="_blank">email.test.php</a> jest dostępna do testowania i rozwiązywania problemów z konfiguracją poczty PHP.</li>
<li>Sending a newsroom message: Display a news to user directly in the application through the newsroom (bell icon on the left menu)</li>
<li>Outgoing webhooks: Allow integration with a third-party application by sending structured data to a defined URL.</li>
</ol>
</p>

View File

@@ -1022,6 +1022,7 @@ Dict::Add('PT BR', 'Brazilian', 'Brazilian', array(
<ol>
<li>Envio de uma mensagem de e-mail: Tais ações também definem o modelo a ser usado para enviar o e-mail, bem como os demais parâmetros da mensagem, como destinatário(s), prioridade, etc.<br />
Uma página especial: <a href="../setup/email.test.php" target="_blank">email.test.php</a> está disponível para testar e solucionar problemas de configuração de e-mail PHP.</li>
<li>Sending a newsroom message: Display a news to user directly in the application through the newsroom (bell icon on the left menu)</li>
<li>Webhooks de saída: permite a integração com um aplicativo de terceiros enviando dados estruturados para um URL definido.</li>
</ol>
</p>

View File

@@ -1023,6 +1023,7 @@ Dict::Add('RU RU', 'Russian', 'Русский', array(
<ol>
<li>Sending an email message: Such actions also define the template to be used for sending the email as well as the other parameters of the message like the recipients, importance, etc.<br />
Для тестирования и устранения неполадок в настройках почты доступна специальная страница: <a href="../setup/email.test.php" target="_blank">email.test.php</a>.</li>
<li>Sending a newsroom message: Display a news to user directly in the application through the newsroom (bell icon on the left menu)</li>
<li>Outgoing webhooks: Allow integration with a third-party application by sending structured data to a defined URL.</li>
</ol>
</p>

View File

@@ -1013,6 +1013,7 @@ Dict::Add('SK SK', 'Slovak', 'Slovenčina', array(
<ol>
<li>Sending an email message: Such actions also define the template to be used for sending the email as well as the other parameters of the message like the recipients, importance, etc.<br />
Špeciálna stránka: <a href="../setup/email.test.php" target="_blank">email.test.php</a> je dostupná pre testovanie a odstraňovanie problémov Vašej PHP mailovej konfigurácie.</li>
<li>Sending a newsroom message: Display a news to user directly in the application through the newsroom (bell icon on the left menu)</li>
<li>Outgoing webhooks: Allow integration with a third-party application by sending structured data to a defined URL.</li>
</ol>
</p>

View File

@@ -1022,6 +1022,7 @@ Dict::Add('TR TR', 'Turkish', 'Türkçe', array(
<ol>
<li>Sending an email message: Such actions also define the template to be used for sending the email as well as the other parameters of the message like the recipients, importance, etc.<br />
Özel sayfa: <a href="../setup/email.test.php" target="_blank">email.test.php</a> PHP e-posta konfigürnunu test ediniz.</li>
<li>Sending a newsroom message: Display a news to user directly in the application through the newsroom (bell icon on the left menu)</li>
<li>Outgoing webhooks: Allow integration with a third-party application by sending structured data to a defined URL.</li>
</ol>
</p>

View File

@@ -1060,6 +1060,7 @@ Dict::Add('ZH CN', 'Chinese', '简体中文', array(
<ol>
<li>发送电子邮件: 此动作同时需要指定发送的邮件所使用的模板, 以及一些其他参数, 例如收件人, 优先级, 等.<br />
这里有一个专用的页面: <a href="../setup/email.test.php" target="_blank">email.test.php</a>可用于测试和调试PHP的邮件配置.</li>
<li>Sending a newsroom message: Display a news to user directly in the application through the newsroom (bell icon on the left menu)</li>
<li>外部webhook: 允许通过发送结构化数据到指定URL来与第三方应用集成.</li>
</ol>
</p>

View File

@@ -117,7 +117,7 @@ class AjaxRenderController
}
}
}
$sObjHighlightClass = $aObject[$sAlias]->GetHilightClass();
$sObjHighlightClass = MetaModel::GetHilightClass($sClass, $aObject[$sAlias]);
if (!empty($sObjHighlightClass)) {
$aObj['@class'] = 'ibo-is-'.$sObjHighlightClass;
}

View File

@@ -8,36 +8,38 @@ use TokenValidation;
class TokenValidationTest extends ItopDataTestCase
{
/**
* @param string $sSetupToken
*
* @return string
*/
public function createSetupTokenFile(string $sSetupToken): string
{
$sSetupTokenFile = APPROOT.'data/.setup';
file_put_contents($sSetupTokenFile, $sSetupToken);
/**
* @param string $sSetupToken
*
* @return string
*/
public function createSetupTokenFile(string $sSetupToken): string
{
$sSetupTokenFile = APPROOT . 'data/.setup';
file_put_contents($sSetupTokenFile, $sSetupToken);
return $sSetupTokenFile;
}protected function setUp(): void
{
parent::setUp();
$this->RequireOnceItopFile('datamodels/2.x/itop-hub-connector/TokenValidation.php');
}
return $sSetupTokenFile;
}
public function testLaunch()
{
$oTokenValidation = new TokenValidation();
/**
* @group itop-community
* @return void
*/
public function testLaunch()
{
$this->RequireOnceItopFile('datamodels/2.x/itop-hub-connector/TokenValidation.php');
$sSetupToken = bin2hex(random_bytes(12));
$this->assertFalse($oTokenValidation->isSetupTokenValid('lol'));
$this->assertFalse($oTokenValidation->isSetupTokenValid(''));
$this->assertFalse($oTokenValidation->isSetupTokenValid($sSetupToken));
$this->createSetupTokenFile($sSetupToken);
$this->assertFalse($oTokenValidation->isSetupTokenValid('lol'));
$this->createSetupTokenFile($sSetupToken);
$this->assertFalse($oTokenValidation->isSetupTokenValid(''));
$this->createSetupTokenFile($sSetupToken);
$this->assertTrue($oTokenValidation->isSetupTokenValid($sSetupToken));
}
$oTokenValidation = new TokenValidation();
$sSetupToken = bin2hex(random_bytes(12));
$this->assertFalse($oTokenValidation->isSetupTokenValid('lol'));
$this->assertFalse($oTokenValidation->isSetupTokenValid(''));
$this->assertFalse($oTokenValidation->isSetupTokenValid($sSetupToken));
$this->createSetupTokenFile($sSetupToken);
$this->assertFalse($oTokenValidation->isSetupTokenValid('lol'));
$this->createSetupTokenFile($sSetupToken);
$this->assertFalse($oTokenValidation->isSetupTokenValid(''));
$this->createSetupTokenFile($sSetupToken);
$this->assertTrue($oTokenValidation->isSetupTokenValid($sSetupToken));
}
}