markTestIncomplete('Test works fine but not in queue on Jenkins'); return; $this->_backup = array( '_REQUEST' => $_REQUEST, 'sugarCache' => sugarCache::$isCacheReset ); $beanList = array(); $beanFiles = array(); require('include/modules.php'); $GLOBALS['beanList'] = $beanList; $GLOBALS['beanFiles'] = $beanFiles; $GLOBALS['current_user'] = SugarTestUserUtilities::createAnonymousUser(true, 1); $GLOBALS['app_list_strings'] = return_app_list_strings_language($GLOBALS['current_language']); } public function tearDown() { SugarTestUserUtilities::removeAllCreatedAnonymousUsers(); unset($GLOBALS['current_user']); unset($GLOBALS['app_list_strings']); unset($GLOBALS['beanList']); unset($GLOBALS['beanFiles']); rmdir_recursive('custom/modules/Accounts/metadata'); rmdir_recursive('custom/modules/Accounts/Ext'); rmdir_recursive('custom/modules/Accounts/language'); $_REQUEST = $this->_backup['_REQUEST']; sugarCache::$isCacheReset = $this->_backup['sugarCache']; unset($GLOBALS['reload_vardefs']); } /** * Test tries to assert that field is not exist after removal it from subpanel * * @group 46196 */ public function testRemoveCustomFieldFromSubpanelForCustomRelation() { $controller = new ModuleBuilderController; $module_name = 'Accounts'; $_REQUEST['view_module'] = $module_name; $test_field_name = 'testfield_222222'; $_REQUEST['name'] = $test_field_name; $_REQUEST['labelValue'] = 'testfield 222222'; $_REQUEST['label'] = 'LBL_TESTFIELD_222222'; $_REQUEST['type'] = 'varchar'; $controller->action_SaveField(); $_REQUEST['view_module'] = $module_name; $_REQUEST['relationship_type'] = 'many-to-many'; $_REQUEST['lhs_module'] = $module_name; $_REQUEST['lhs_label'] = $module_name; $_REQUEST['rhs_module'] = $module_name; $_REQUEST['rhs_label'] = $module_name; $_REQUEST['lhs_subpanel'] = 'default'; $_REQUEST['rhs_subpanel'] = 'default'; $controller->action_SaveRelationship(); $parser = ParserFactory::getParser('listview', $module_name, null, 'accounts_accounts'); $field = $parser->_fielddefs[$test_field_name . '_c']; $parser->_viewdefs[$test_field_name . '_c'] = $field; $parser->handleSave(false); $_REQUEST['type'] = 'varchar'; $_REQUEST['name'] = $test_field_name . '_c'; $controller->action_DeleteField(); $parser = ParserFactory::getParser('listview', $module_name, null, 'accounts_accounts'); $_REQUEST['relationship_name'] = 'accounts_accounts'; $controller->action_DeleteRelationship(); $this->assertArrayNotHasKey($test_field_name . '_c', $parser->_viewdefs); } }