_default_max_tabs_set == isset($GLOBALS['sugar_config']['default_max_tabs']); if ($this->_default_max_tabs_set) { $this->_default_max_tabs = $GLOBALS['sugar_config']['default_max_tabs']; } $beanList = array(); $beanFiles = array(); require('include/modules.php'); $GLOBALS['beanList'] = $beanList; $GLOBALS['beanFiles'] = $beanFiles; $GLOBALS['current_user'] = SugarTestUserUtilities::createAnonymousUser(); $GLOBALS['current_user']->is_admin = '1'; $GLOBALS['sugar_config']['default_max_tabs'] = $this->_max_tabs_test; if(!isset($GLOBALS['current_language'])) { $GLOBALS['current_language'] = 'en_us'; } $GLOBALS['app_list_strings'] = return_app_list_strings_language($GLOBALS['current_language']); $GLOBALS['app_strings'] = return_application_language($GLOBALS['current_language']); $GLOBALS['mod_strings'] = return_module_language($GLOBALS['current_language'], 'Users'); $GLOBALS['request_string'] = ''; } public function tearDown() { if ($this->_default_max_tabs_set) { $GLOBALS['sugar_config']['default_max_tabs'] = $this->_default_max_tabs; } else { unset($GLOBALS['sugar_config']['default_max_tabs']); } unset($GLOBALS['beanFiles']); unset($GLOBALS['beanList']); unset($GLOBALS['current_user']); unset($GLOBALS['app_list_strings']); unset($GLOBALS['app_strings']); unset($GLOBALS['request_string']); SugarTestUserUtilities::removeAllCreatedAnonymousUsers(); SugarTestContactUtilities::removeAllCreatedContacts(); } protected function setupMyView() { global $current_user; $GLOBALS['module'] = 'Users'; $GLOBALS['action'] = 'EditView'; $_REQUEST['action'] = $GLOBALS['action']; $view = ViewFactory::loadView('edit', 'Users', $current_user, array('bean'=>$current_user),''); $view->preDisplay(); return $view; } public function testUsingDefaultMaxTabsForOptionsValues() { global $current_user, $locale, $sugar_config; $view = $this->setupMyView(); $view->display(); $this->expectOutputRegex('/10<\/option>.*<\/select>/ms'); } /** * @ticket 42719 */ public function testUsersDefaultMaxTabsSettingHonored() { global $current_user, $locale, $sugar_config; $current_user->setPreference('max_tabs', 3, 0, 'global'); $view = $this->setupMyView(); $view->display(); $this->expectOutputRegex('/