public function testget_module_dir_list()
 {
     //execute the method and test if it returns expected values
     $expected = array('Accounts' => 'Accounts', 'ACL' => 'ACL', 'ACLActions' => 'ACLActions', 'ACLRoles' => 'ACLRoles', 'Activities' => 'Activities', 'Administration' => 'Administration', 'Alerts' => 'Alerts', 'AM_ProjectTemplates' => 'AM_ProjectTemplates', 'AM_TaskTemplates' => 'AM_TaskTemplates', 'AOBH_BusinessHours' => 'AOBH_BusinessHours', 'AOD_Index' => 'AOD_Index', 'AOD_IndexEvent' => 'AOD_IndexEvent', 'AOK_KnowledgeBase' => 'AOK_KnowledgeBase', 'AOK_Knowledge_Base_Categories' => 'AOK_Knowledge_Base_Categories', 'AOP_Case_Events' => 'AOP_Case_Events', 'AOP_Case_Updates' => 'AOP_Case_Updates', 'AOR_Charts' => 'AOR_Charts', 'AOR_Conditions' => 'AOR_Conditions', 'AOR_Fields' => 'AOR_Fields', 'AOR_Reports' => 'AOR_Reports', 'AOR_Scheduled_Reports' => 'AOR_Scheduled_Reports', 'AOS_Contracts' => 'AOS_Contracts', 'AOS_Invoices' => 'AOS_Invoices', 'AOS_Line_Item_Groups' => 'AOS_Line_Item_Groups', 'AOS_PDF_Templates' => 'AOS_PDF_Templates', 'AOS_Products' => 'AOS_Products', 'AOS_Products_Quotes' => 'AOS_Products_Quotes', 'AOS_Product_Categories' => 'AOS_Product_Categories', 'AOS_Quotes' => 'AOS_Quotes', 'AOW_Actions' => 'AOW_Actions', 'AOW_Conditions' => 'AOW_Conditions', 'AOW_Processed' => 'AOW_Processed', 'AOW_WorkFlow' => 'AOW_WorkFlow', 'Audit' => 'Audit', 'Bugs' => 'Bugs', 'Calendar' => 'Calendar', 'Calls' => 'Calls', 'Calls_Reschedule' => 'Calls_Reschedule', 'CampaignLog' => 'CampaignLog', 'Campaigns' => 'Campaigns', 'CampaignTrackers' => 'CampaignTrackers', 'Cases' => 'Cases', 'Charts' => 'Charts', 'Configurator' => 'Configurator', 'Connectors' => 'Connectors', 'Contacts' => 'Contacts', 'Currencies' => 'Currencies', 'Delegates' => 'Delegates', 'DocumentRevisions' => 'DocumentRevisions', 'Documents' => 'Documents', 'DynamicFields' => 'DynamicFields', 'EAPM' => 'EAPM', 'EmailAddresses' => 'EmailAddresses', 'EmailMan' => 'EmailMan', 'EmailMarketing' => 'EmailMarketing', 'Emails' => 'Emails', 'EmailTemplates' => 'EmailTemplates', 'EmailText' => 'EmailText', 'Employees' => 'Employees', 'Favorites' => 'Favorites', 'FP_events' => 'FP_events', 'FP_Event_Locations' => 'FP_Event_Locations', 'Groups' => 'Groups', 'Help' => 'Help', 'History' => 'History', 'Home' => 'Home', 'iCals' => 'iCals', 'Import' => 'Import', 'InboundEmail' => 'InboundEmail', 'jjwg_Address_Cache' => 'jjwg_Address_Cache', 'jjwg_Areas' => 'jjwg_Areas', 'jjwg_Maps' => 'jjwg_Maps', 'jjwg_Markers' => 'jjwg_Markers', 'LabelEditor' => 'LabelEditor', 'Leads' => 'Leads', 'MailMerge' => 'MailMerge', 'Meetings' => 'Meetings', 'MergeRecords' => 'MergeRecords', 'ModuleBuilder' => 'ModuleBuilder', 'MySettings' => 'MySettings', 'Notes' => 'Notes', 'OAuthKeys' => 'OAuthKeys', 'OAuthTokens' => 'OAuthTokens', 'Opportunities' => 'Opportunities', 'OptimisticLock' => 'OptimisticLock', 'OutboundEmailAccounts' => 'OutboundEmailAccounts', 'Project' => 'Project', 'ProjectTask' => 'ProjectTask', 'ProspectLists' => 'ProspectLists', 'Prospects' => 'Prospects', 'Relationships' => 'Relationships', 'Reminders' => 'Reminders', 'Reminders_Invitees' => 'Reminders_Invitees', 'ResourceCalendar' => 'ResourceCalendar', 'Releases' => 'Releases', 'Roles' => 'Roles', 'SavedSearch' => 'SavedSearch', 'Schedulers' => 'Schedulers', 'SchedulersJobs' => 'SchedulersJobs', 'SecurityGroups' => 'SecurityGroups', 'Spots' => 'Spots', 'Studio' => 'Studio', 'SugarFeed' => 'SugarFeed', 'Tasks' => 'Tasks', 'Trackers' => 'Trackers', 'TemplateSectionLine' => 'TemplateSectionLine', 'UpgradeWizard' => 'UpgradeWizard', 'UserPreferences' => 'UserPreferences', 'Users' => 'Users', 'vCals' => 'vCals');
     $actual = get_module_dir_list();
     sort($actual);
     sort($expected);
     $this->assertSame($expected, $actual);
 }
 function install_copy()
 {
     if (isset($this->installdefs['copy'])) {
         /* BEGIN - RESTORE POINT - by MR. MILK August 31, 2005 02:22:11 PM */
         $backup_path = clean_path(remove_file_extension(urldecode($_REQUEST['install_file'])) . "-restore");
         /* END - RESTORE POINT - by MR. MILK August 31, 2005 02:22:18 PM */
         foreach ($this->installdefs['copy'] as $cp) {
             $GLOBALS['log']->debug("Copying ..." . $cp['from'] . " to " . $cp['to']);
             /* BEGIN - RESTORE POINT - by MR. MILK August 31, 2005 02:22:11 PM */
             //$this->copy_path($cp['from'], $cp['to']);
             $this->copy_path($cp['from'], $cp['to'], $backup_path);
             /* END - RESTORE POINT - by MR. MILK August 31, 2005 02:22:18 PM */
         }
         //here we should get the module list again as we could have copied something to the modules dir
         $this->modules = get_module_dir_list();
     }
 }
 function ModuleInstaller()
 {
     $this->modules = get_module_dir_list();
     $this->db =& DBManagerFactory::getInstance();
 }