public function test_update_custom_vardefs_without_searchfields() { unlink("{$this->module_dir}/metadata/SearchFields.php"); $this->assertTrue(!file_exists("{$this->module_dir}/metadata/SearchFields.php"), 'Assert that we have a SearchFields.php file'); $this->assertTrue(file_exists("{$this->module_dir}/vardefs.php"), 'Assert that we have a vardefs.php file'); require_once 'modules/UpgradeWizard/uw_utils.php'; add_unified_search_to_custom_modules_vardefs(); require_once 'modules/Home/UnifiedSearchAdvanced.php'; $usa = new UnifiedSearchAdvanced(); $usa->buildCache(); $this->assertTrue(file_exists(sugar_cached('modules/unified_search_modules.php')), 'Assert that we have a unified_search_modules.php file'); include sugar_cached('modules/unified_search_modules.php'); $this->assertTrue(empty($unified_search_modules['clabc_Bug36845Test']), 'Assert that the custom module was not added to unified_search_modules.php'); }
public function test_update_custom_vardefs_without_searchfields() { if (!file_exists("custom/{$this->module_dir}/metadata")) { mkdir_recursive("custom/{$this->module_dir}/metadata"); } copy("{$this->module_dir}/metadata/SearchFields.php", "custom/{$this->module_dir}/metadata/SearchFields.php"); unlink("{$this->module_dir}/metadata/SearchFields.php"); $this->assertTrue(!file_exists("{$this->module_dir}/metadata/SearchFields.php"), 'Assert that we do not have a SearchFields.php file in modules directory'); $this->assertTrue(file_exists("{$this->module_dir}/vardefs.php"), 'Assert that we have a vardefs.php file'); require_once 'modules/UpgradeWizard/uw_utils.php'; add_unified_search_to_custom_modules_vardefs(); require_once 'modules/Home/UnifiedSearchAdvanced.php'; $usa = new UnifiedSearchAdvanced(); $usa->buildCache(); $this->assertTrue(file_exists("cache/modules/unified_search_modules.php"), 'Assert that we have a unified_search_modules.php file'); include 'cache/modules/unified_search_modules.php'; //echo var_export($unified_search_modules['clabc_Bug36845Test'], true); $this->assertTrue(isset($unified_search_modules['clabc_Bug36845Test']), 'Assert that the custom module was added to unified_search_modules.php'); }
//unset the logger previously instantiated if (file_exists('include/SugarLogger/LoggerManager.php')) { unset($GLOBALS['log']); $GLOBALS['log'] = LoggerManager::getLogger('SugarCRM'); } //Upgrade connectors if ($_SESSION['current_db_version'] < '610' && function_exists('upgrade_connectors')) { upgrade_connectors($path); } if ($_SESSION['current_db_version'] < '620' && ($sugar_config['dbconfig']['db_type'] == 'mssql' || $sugar_config['dbconfig']['db_type'] == 'oci8')) { repair_long_relationship_names($path); } //Global search support if ($_SESSION['current_db_version'] < '620' && function_exists('add_unified_search_to_custom_modules_vardefs')) { logThis('Add global search for custom modules start .', $path); add_unified_search_to_custom_modules_vardefs(); logThis('Add global search for custom modules finished .', $path); } //Upgrade system displayed tabs and subpanels if (function_exists('upgradeDisplayedTabsAndSubpanels')) { upgradeDisplayedTabsAndSubpanels($_SESSION['current_db_version']); } //Unlink files that have been removed if (function_exists('unlinkUpgradeFiles')) { unlinkUpgradeFiles($_SESSION['current_db_version']); } require_once 'modules/Administration/upgrade_custom_relationships.php'; upgrade_custom_relationships(); require_once 'modules/UpgradeWizard/uw_utils.php'; if ($_SESSION['current_db_version'] < '620') { upgradeDateTimeFields($path);