Ejemplo n.º 1
0
 /**
  * @ticket 49281
  */
 public function testInsertUpdateLongData()
 {
     $acc = new Account();
     $acc->name = "PHPUNIT test";
     $acc->assigned_user_id = $GLOBALS['current_user']->id;
     $acc->sic_code = 'mnbvcxzasdfghjklpoiuytrewqmnbvcxzasdfghjklpoiuytre';
     $acc->save();
     $id = $acc->id;
     SugarTestAccountUtilities::setCreatedAccount(array($id));
     $acc = new Account();
     $acc->retrieve($id);
     $this->assertEquals('mnbvcxzasd', $acc->sic_code);
     $acc->sic_code = 'f094f59daaed0983a6a2e5913ddcc5fb';
     $acc->save();
     $acc = new Account();
     $acc->retrieve($id);
     $this->assertEquals('f094f59daa', $acc->sic_code);
 }
Ejemplo n.º 2
0
 public function _setEntriesForAccount()
 {
     $this->_login();
     global $timedate;
     $current_date = $timedate->nowDb();
     $time = mt_rand();
     $name = 'SugarAccount' . $time;
     $email1 = 'account@' . $time . 'sugar.com';
     $result = $this->_soapClient->call('set_entries', array('session' => $this->_sessionId, 'module_name' => 'Accounts', 'name_value_lists' => array(array(array('name' => 'name', 'value' => "{$name}"), array('name' => 'email1', 'value' => "{$email1}")))));
     $soap_version_test_accountId = $result['ids'][0];
     SugarTestAccountUtilities::setCreatedAccount(array($soap_version_test_accountId));
     return $result;
 }
Ejemplo n.º 3
0
 /**
  * @group 53223
  */
 public function testOneToManyRelationshipModule2Modult()
 {
     $_REQUEST['relate_id'] = $this->parentAccount->id;
     $_REQUEST['relate_to'] = $this->relationship->getName();
     // create new account
     $objAccount = new Account();
     $objAccount->name = "AccountBug53223" . $_REQUEST['relate_to'] . time();
     $objAccount->save();
     SugarTestAccountUtilities::setCreatedAccount(array($objAccount->id));
     // Retrieve new data
     $this->parentAccount->retrieve($this->parentAccount->id);
     $objAccount->retrieve($objAccount->id);
     $this->parentAccount->load_relationship($this->relationship->getName());
     $objAccount->load_relationship($this->relationship->getName());
     // Getting data of subpanel of parent bean
     $_REQUEST['module'] = 'Accounts';
     $_REQUEST['action'] = 'DetailView';
     $_REQUEST['record'] = $this->parentAccount->id;
     $_SERVER['REQUEST_METHOD'] = 'GET';
     unset($GLOBALS['focus']);
     $subpanels = new SubPanelDefinitions($this->parentAccount, 'Accounts');
     $subpanelDef = $subpanels->load_subpanel($this->relationship->getName() . 'accounts_ida');
     $subpanel = new SubPanel('Accounts', $this->parentAccount->id, 'default', $subpanelDef);
     $subpanel->setTemplateFile('include/SubPanel/SubPanelDynamic.html');
     $subpanel->display();
     $actual = $this->getActualOutput();
     $this->assertContains($objAccount->name, $actual, 'Account name is not displayed in subpanel of parent account');
     ob_clean();
     // Getting data of subpanel of child bean
     $_REQUEST['module'] = 'Accounts';
     $_REQUEST['action'] = 'DetailView';
     $_REQUEST['record'] = $objAccount->id;
     $_SERVER['REQUEST_METHOD'] = 'GET';
     unset($GLOBALS['focus']);
     $subpanels = new SubPanelDefinitions($objAccount, 'Accounts');
     $subpanelDef = $subpanels->load_subpanel($this->relationship->getName() . 'accounts_ida');
     $subpanel = new SubPanel('Accounts', $objAccount->id, 'default', $subpanelDef);
     $subpanel->setTemplateFile('include/SubPanel/SubPanelDynamic.html');
     $subpanel->display();
     $actual = $this->getActualOutput();
     $this->assertNotContains($this->parentAccount->name, $actual, 'Parent account name is displayed in subpanel of child aaccount');
 }