diff --git a/tests/php-unit-tests/src/BaseTestCase/ItopDataTestCase.php b/tests/php-unit-tests/src/BaseTestCase/ItopDataTestCase.php index fbcb2e37d..8051180f3 100644 --- a/tests/php-unit-tests/src/BaseTestCase/ItopDataTestCase.php +++ b/tests/php-unit-tests/src/BaseTestCase/ItopDataTestCase.php @@ -143,6 +143,7 @@ abstract class ItopDataTestCase extends ItopTestCase // Leave the place clean \UserRights::Logoff(); $this->SetNonPublicStaticProperty(UserRights::class, 'm_aCacheUsers', []); + $this->ResetMetaModelQueyCacheGetObject(); foreach ($this->aEventListeners as $sListenerId) { EventService::UnRegisterListener($sListenerId); @@ -153,6 +154,13 @@ abstract class ItopDataTestCase extends ItopTestCase parent::tearDown(); } + /** + * Helper to reset the metamodel cache : for a class and a key it will contain the SQL query, that could include silo filter + */ + protected function ResetMetaModelQueyCacheGetObject() { + $this->SetNonPublicStaticProperty(MetaModel::class, 'aQueryCacheGetObject', []); + } + /** * @inheritDoc */ diff --git a/tests/php-unit-tests/unitary-tests/core/DBObjectTest.php b/tests/php-unit-tests/unitary-tests/core/DBObjectTest.php index 85e7c6ef3..fcbbeb251 100644 --- a/tests/php-unit-tests/unitary-tests/core/DBObjectTest.php +++ b/tests/php-unit-tests/unitary-tests/core/DBObjectTest.php @@ -671,14 +671,6 @@ class DBObjectTest extends ItopDataTestCase } } - /** - * Helper to reset the metamodel cache - * We might need to create something generic and add it to {@see UserRights::Logoff()} ? - */ - private function ResetMetaModelQueyCacheGetObject() { - $this->SetNonPublicStaticProperty(MetaModel::class, 'aQueryCacheGetObject', []); - } - private function CreateDemoOrgUser(Organization $oDemoOrg, string $sProfileId): User { utils::GetConfig()->SetModuleSetting('authent-local', 'password_validation.pattern', '');