예제 #1
0
 public function setUp()
 {
     global $current_user, $sugar_config;
     SugarTestHelper::setUp('current_user', array(true));
     $current_user->setPreference('dec_sep', ',');
     $current_user->setPreference('num_grp_sep', '.');
     $current_user->setPreference('default_currency_significant_digits', 3);
     SugarTestHelper::setUp('app_list_strings');
     SugarTestHelper::setUp('beanFiles');
     SugarTestHelper::setUp('beanList');
     parent::setUp();
     $this->lm = new LayoutManager();
     $this->lm->setAttribute('reporter', new stdClass());
     $this->currency_51568 = new Currency();
     $this->currency_51568->symbol = 'TT';
     $this->currency_51568->conversion_rate = 0.5;
     $this->currency_51568->save(false);
     $this->currency_system = new Currency();
     $this->currency_system->retrieve(-99);
     $this->backupSymbol = $this->currency_system->symbol;
     $this->currency_system->symbol = '¥';
     $this->currency_system->save(false);
     $sugar_config['default_currency_symbol'] = '¥';
     get_number_seperators(true);
 }
예제 #2
0
 public function setUp()
 {
     SugarTestHelper::setUp('current_user', array(true));
     SugarTestHelper::setUp('app_list_strings');
     SugarTestHelper::setUp('beanFiles');
     SugarTestHelper::setUp('beanList');
     parent::setUp();
 }
예제 #3
0
 public function tearDown()
 {
     unset($GLOBALS['module']);
     unset($GLOBALS['action']);
     unset($GLOBALS['mod_strings']);
     unset($GLOBALS['current_user']);
     parent::tearDown();
 }
예제 #4
0
 /**
  * Tears down the fixture, for example, close a network connection.
  * This method is called after a test is executed.
  */
 public function tearDown()
 {
     SugarTestAccountUtilities::removeAllCreatedAccounts();
     SugarTestOpportunityUtilities::removeAllCreatedOpportunities();
     SugarTestContactUtilities::removeAllCreatedContacts();
     parent::tearDown();
     SugarTestHelper::tearDown();
 }
예제 #5
0
 public function setUp()
 {
     if (!function_exists('gzinflate')) {
         $this->markTestSkipped("No gzip - skipping");
     }
     if (!function_exists('simplexml_load_string')) {
         $this->markTestSkipped("No SimpleXML - skipping");
     }
     parent::setUp();
 }
예제 #6
0
 /**
  * Create test user
  *
  */
 public function setUp()
 {
     $beanList = array();
     $beanFiles = array();
     require 'include/modules.php';
     $GLOBALS['beanList'] = $beanList;
     $GLOBALS['beanFiles'] = $beanFiles;
     $this->_soapClient = new nusoapclient($this->_soapURL, false, false, false, false, false, 600, 600);
     parent::setUp();
     $GLOBALS['db']->commit();
 }
예제 #7
0
 public function tearDown()
 {
     $_REQUEST = array();
     sugar_cache_clear('mod_strings.en_us');
     if (file_exists('custom/modules/' . $this->module . '/language/en_us.lang.php')) {
         unlink('custom/modules/' . $this->module . '/language/en_us.lang.php');
     }
     if (file_exists('custom/modules/' . $this->add_module . '/language/en_us.lang.php')) {
         unlink('custom/modules/' . $this->add_module . '/language/en_us.lang.php');
     }
     SugarTestHelper::tearDown();
     parent::tearDown();
 }
예제 #8
0
 public function setup()
 {
     SugarTestHelper::setUp('beanList');
     SugarTestHelper::setUp('beanFiles');
     SugarTestHelper::setUp('current_user', array(true, 1));
     SugarTestHelper::setUp('app_list_strings');
     SugarTestHelper::setUp('mod_strings', array('ModuleBuilder'));
     parent::setUp();
     $this->createCustomField();
     $this->getSugarWidgetFieldRelate();
     $this->account = SugarTestAccountUtilities::createAccount();
     $this->contact1 = SugarTestContactUtilities::createContact();
     $this->contact2 = SugarTestContactUtilities::createContact();
 }
예제 #9
0
 public function tearDown()
 {
     unset($GLOBALS['module']);
     unset($GLOBALS['action']);
     unset($GLOBALS['mod_strings']);
     unset($GLOBALS['current_user']);
     unset($_REQUEST);
     $GLOBALS['db']->query("DELETE FROM notes WHERE id IN ('" . $this->note1->id . "','" . $this->note2->id . "')");
     // Just in case there is a custom table here
     if ($GLOBALS['db']->tableExists('notes_cstm')) {
         $GLOBALS['db']->query("DELETE FROM notes_cstm WHERE id_c IN ('" . $this->note1->id . "','" . $this->note2->id . "')");
     }
     parent::tearDown();
 }
예제 #10
0
 public function setUp()
 {
     global $locale, $current_user;
     SugarTestHelper::setUp('current_user', array(true));
     $current_user->setPreference('dec_sep', '.');
     $current_user->setPreference('num_grp_sep', ',');
     $current_user->setPreference('default_currency_significant_digits', 2);
     get_number_seperators(true);
     parent::setUp();
     //if locale is not defined, create new global locale object.
     if (empty($locale)) {
         require_once 'include/Localization/Localization.php';
         $locale = new Localization();
     }
     //create a new SugarFieldCurrency object
     $this->sfr = new SugarFieldCurrency('currency');
 }
예제 #11
0
 public static function tearDownAfterClass()
 {
     self::$moduleBuilder->getPackage(self::$packageName)->delete();
     $_REQUEST = array();
     SugarTestHelper::tearDown();
     parent::tearDownAfterClass();
 }
예제 #12
0
 public function tearDown()
 {
     foreach ($this->fileNames as $fileNames) {
         @unlink($fileNames);
     }
     parent::tearDown();
 }
예제 #13
0
 public function setUp()
 {
     global $beanList, $beanFiles, $current_user;
     global $beanList, $beanFiles;
     $beanList = array();
     $beanFiles = array();
     require 'include/modules.php';
     $this->_soapURL = $GLOBALS['sugar_config']['site_url'] . '/service/v4_1/soap.php';
     parent::setUp();
     $current_user = SugarTestUserUtilities::createAnonymousUser();
     $this->another_user = SugarTestUserUtilities::createAnonymousUser();
     $this->_login();
     global $current_user;
     $current_user = SugarTestUserUtilities::createAnonymousUser();
     $this->another_user = SugarTestUserUtilities::createAnonymousUser();
     $this->contact1 = SugarTestContactUtilities::createContact();
     $this->contact1->contacts_users_id = $current_user->id;
     $this->contact1->first_name = 'First1';
     $this->contact1->last_name = 'Last1';
     $this->contact1->save();
     $this->contact1->user_sync->add($current_user);
     $this->contact1->sync_contact = 1;
     $this->contact1->save();
     $this->contact2 = SugarTestContactUtilities::createContact();
     $this->contact2->contacts_users_id = $this->another_user->id;
     $this->contact2->first_name = 'First2';
     $this->contact2->last_name = 'Last2';
     $this->contact2->save();
     $this->contact2->user_sync->add($this->another_user);
     $this->contact2->sync_contact = 1;
     $this->contact2->save();
     $this->call1 = SugarTestCallUtilities::createCall();
     $this->call1->name = 'RESTAPI4_1Test1';
     $this->call1->load_relationship('users');
     $this->call1->users->add($current_user);
     $this->call1->save();
     $this->call2 = SugarTestCallUtilities::createCall();
     $this->call2->name = 'RESTAPI4_1Test2';
     $this->call2->load_relationship('users');
     $this->call2->users->add($current_user);
     $this->call2->save();
     $this->meeting1 = SugarTestMeetingUtilities::createMeeting();
     $this->meeting1->name = 'RESTAPI4_1Test1';
     $this->meeting1->load_relationship('users');
     $this->meeting1->users->add($current_user);
     $this->meeting1->save();
     $this->meeting2 = SugarTestMeetingUtilities::createMeeting();
     $this->meeting2->name = 'RESTAPI4_1Test2';
     $this->meeting2->load_relationship('users');
     $this->meeting2->users->add($this->another_user);
     $this->meeting2->save();
     $this->meeting3 = SugarTestMeetingUtilities::createMeeting();
     $this->meeting3->name = 'RESTAPI4_1Test3';
     $this->meeting3->load_relationship('users');
     $this->meeting3->users->add($current_user);
     $this->meeting3->save();
     $this->meeting4 = SugarTestMeetingUtilities::createMeeting();
     $this->meeting4->name = 'SOAPAPI4_1Test4';
     $this->meeting4->load_relationship('users');
     $this->meeting4->users->add($current_user);
     $this->meeting4->mark_deleted($this->meeting4->id);
     $this->meeting4->deleted = 1;
     $this->meeting4->save();
     $GLOBALS['db']->commit();
 }
예제 #14
0
 protected function tearDown()
 {
     SugarTestHelper::tearDown();
     parent::tearDown();
 }
예제 #15
0
 public function tearDown()
 {
     ParserLabel::removeLabel($GLOBALS['current_language'], $this->idLabelName, $GLOBALS['mod_strings'][$this->idLabelName], $this->module);
     SugarTestHelper::tearDown();
     parent::tearDown();
 }
예제 #16
0
 public static function tearDownAfterClass()
 {
     self::$field->delete(self::$dynamicField);
     SugarTestHelper::tearDown();
     parent::tearDownAfterClass();
 }
예제 #17
0
 public function tearDown()
 {
     SugarTestProspectUtilities::removeAllCreatedProspects();
     parent::tearDown();
 }
예제 #18
0
 public function tearDown()
 {
     $this->deleteFields();
     SugarTestHelper::tearDown();
     parent::tearDown();
 }
예제 #19
0
 public function tearDown()
 {
     SugarTestHelper::tearDown();
     parent::tearDown();
 }
예제 #20
0
 /**
  * Create user, account, contact
  */
 public function setUp()
 {
     $this->_account1 = $this->createAccount("Account Bug61159Test");
     $this->_account2 = $this->createAccount("Account Bug61159Test");
     $this->_contact = $this->createContact($this->_account2->id, "Account Bug61159Test");
     $this->_contact2 = $this->createContact(0, "Account Bug61159Test");
     $this->_deletedAcc = $this->createAccount("Account Bug61159Test 2", 1);
     $this->_deletedAccContact = $this->createContact($this->_deletedAcc->id, "Account Bug61159Test 2");
     parent::setUp();
 }