Esempio n. 1
0
 public function tearDown()
 {
     $mbc = new ModuleBuilderController();
     $this->currencyFieldDef1['name'] = 'c1_c';
     $_REQUEST = $this->currencyFieldDef1;
     $mbc->action_DeleteField();
     $this->currencyFieldDef2['name'] = 'c2_c';
     $_REQUEST = $this->currencyFieldDef2;
     $mbc->action_DeleteField();
     SugarTestUserUtilities::removeAllCreatedAnonymousUsers();
     unset($GLOBALS['current_user']);
     unset($GLOBALS['beanList']);
     unset($GLOBALS['beanFiles']);
     unset($GLOBALS['app_list_strings']);
     unset($_REQUEST);
 }
Esempio n. 2
0
 /**
  * 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);
 }