mirror of
https://github.com/Combodo/iTop.git
synced 2026-02-13 15:34:12 +01:00
Merge remote-tracking branch 'origin/support/3.0' into support/3.1
This commit is contained in:
@@ -65,6 +65,13 @@ abstract class ItopDataTestCase extends ItopTestCase
|
||||
private $aCreatedObjects = [];
|
||||
private $aEventListeners = [];
|
||||
|
||||
/**
|
||||
* @var bool When testing with silo, there are some cache we need to update on tearDown. Doing it all the time will cost too much, so it's opt-in !
|
||||
* @see tearDown
|
||||
* @see ResetMetaModelQueyCacheGetObject
|
||||
*/
|
||||
protected $bIsUsingSilo = false;
|
||||
|
||||
/**
|
||||
* @var string Default environment to use for test cases
|
||||
*/
|
||||
@@ -141,9 +148,13 @@ abstract class ItopDataTestCase extends ItopTestCase
|
||||
CMDBObject::SetCurrentChange(null);
|
||||
|
||||
// Leave the place clean
|
||||
\UserRights::Logoff();
|
||||
$this->SetNonPublicStaticProperty(UserRights::class, 'm_aCacheUsers', []);
|
||||
$this->ResetMetaModelQueyCacheGetObject();
|
||||
if (UserRights::IsLoggedIn()) {
|
||||
UserRights::Logoff();
|
||||
}
|
||||
$this->SetNonPublicStaticProperty(UserRights::class, 'm_aCacheUsers', []); // we could have cached rollbacked instances
|
||||
if ($this->bIsUsingSilo) {
|
||||
$this->ResetMetaModelQueyCacheGetObject();
|
||||
}
|
||||
|
||||
foreach ($this->aEventListeners as $sListenerId) {
|
||||
EventService::UnRegisterListener($sListenerId);
|
||||
|
||||
Reference in New Issue
Block a user