N°4236 - Fix user with no admin right can't connect in iTop when log_usage set to true

This commit is contained in:
Molkobain
2021-08-12 11:13:59 +02:00
parent 0fc912b357
commit 7577fbb8bf
2 changed files with 42 additions and 11 deletions

View File

@@ -180,7 +180,6 @@ class MetaModelTest extends ItopDataTestCase
}
}
/**
* @dataProvider enumPluginsProvider
*
@@ -273,7 +272,6 @@ class MetaModelTest extends ItopDataTestCase
return $aInterfaces;
}
/**
* @group itopRequestMgmt
* @dataProvider GetEnumStyleProvider
@@ -335,6 +333,35 @@ class MetaModelTest extends ItopDataTestCase
['lnkPersonToTeam', true],
];
}
/**
* @covers \MetaModel::IsObjectInDB
* @dataProvider IsObjectInDBProvider
*
* @param int $iKeyOffset Offset to apply on the key of the test object. This is necessary to test an object that doesn't exist yet in any DB as we can't know what is the last existing object key.
* @param $bExpectedResult
*
* @throws \CoreException
* @throws \MySQLException
* @throws \MySQLQueryHasNoResultException
*/
public function testIsObjectInDB(int $iKeyOffset, $bExpectedResult)
{
$oPerson = $this->CreatePerson(1, 1);
$sClass = get_class($oPerson);
$iKey = $oPerson->GetKey() + $iKeyOffset;
$bTestResult = MetaModel::IsObjectInDB($sClass, $iKey);
$this->assertEquals($bTestResult, $bExpectedResult);
}
public function IsObjectInDBProvider(): array
{
return [
'Existing person' => [0, true],
'Non existing person' => [10, false],
];
}
}
abstract class Wizzard