RequireOnceItopFile('setup/module/iTopModulesDependencyValidationService.php'); } protected function tearDown(): void { parent::tearDown(); // TODO: Change the autogenerated stub foreach ($this->aFilesToRemove as $sTmpFile){ @unlink($sTmpFile); } iTopModulesDependencyValidationService::SetInstance(null); } public function testListDeclaredFullnameClassesFromPhpFile() { $aExpected = [ 'CMDBChangeOp', 'CMDBChangeOpCreate', 'CMDBChangeOpDelete', 'CMDBChangeOpSetAttribute', 'CMDBChangeOpSetAttributeScalar', 'CMDBChangeOpSetAttributeTagSet', 'CMDBChangeOpSetAttributeURL', 'CMDBChangeOpSetAttributeBlob', 'CMDBChangeOpSetAttributeOneWayPassword', 'CMDBChangeOpSetAttributeEncrypted', 'CMDBChangeOpSetAttributeText', 'CMDBChangeOpSetAttributeLongText', 'CMDBChangeOpSetAttributeHTML', 'CMDBChangeOpSetAttributeCaseLog', 'CMDBChangeOpPlugin', 'CMDBChangeOpSetAttributeLinksAddRemove', 'CMDBChangeOpSetAttributeLinksTune', 'CMDBChangeOpSetAttributeCustomFields', 'iCMDBChangeOp', ]; $this->assertEquals($aExpected, iTopModulesDependencyValidationService::GetInstance()->ListDeclaredFullnameClassesFromPhpFile(APPROOT . 'core/cmdbchangeop.class.inc.php')); } public function testListDeclaredFullnameClassesFromAutoloadFile() { $aExpected = [ 'Combodo\iTop\OAuthClient\Controller\AjaxOauthClientController', 'Combodo\iTop\OAuthClient\Controller\OAuthClientController', 'Combodo\iTop\OAuthClient\Service\ApplicationUIExtension', 'Combodo\iTop\OAuthClient\Service\PopupMenuExtension', ]; $this->assertEquals($aExpected, iTopModulesDependencyValidationService::GetInstance()->ListDeclaredFullnameClassesFromPhpFile(APPROOT . 'datamodels/2.x/itop-oauth-client/vendor/autoload.php')); } public function testGetFirstFoundDepsUID() { $sOutput=<<assertEquals('Combodo\iTop\MyAccount\Hook\iMyAccountTabContentExtension', iTopModulesDependencyValidationService::GetInstance()->GetFirstFoundDepsUID($sOutput)); $sOutput=<<assertEquals('Combodo\iTop\MyAccount\Hook\iMyAccountTabContentExtension', iTopModulesDependencyValidationService::GetInstance()->GetFirstFoundDepsUID($sOutput)); } }