/**
  * Create test account
  *
  */
 public function setUp()
 {
     $this->_soapURL = $GLOBALS['sugar_config']['site_url'] . '/service/v3_1/soap.php';
     $GLOBALS['current_user'] = SugarTestUserUtilities::createAnonymousUser();
     $this->acc = SugarTestAccountUtilities::createAccount();
     parent::setUp();
 }
Exemple #2
0
 public function setUp()
 {
     global $current_user;
     $current_user = SugarTestUserUtilities::createAnonymousUser();
     $this->email = new Email();
     $this->email->email2init();
 }
Exemple #3
0
 function setUp()
 {
     global $beanList, $beanFiles, $current_user;
     require 'include/modules.php';
     $current_user = SugarTestUserUtilities::createAnonymousUser();
     SugarTestMergeUtilities::setupFiles(array('Meetings'), array('quickcreatedefs'), 'tests/modules/UpgradeWizard/SugarMerge/metadata_files');
 }
Exemple #4
0
 public function setUp()
 {
     $user = SugarTestUserUtilities::createAnonymousUser();
     $user->is_admin = true;
     $user->save();
     $GLOBALS['current_user'] = $user;
 }
Exemple #5
0
 public function setup()
 {
     global $current_user;
     // Create Anon User setted on GMT+2 TimeZone
     $current_user = SugarTestUserUtilities::createAnonymousUser();
     $current_user->setPreference('datef', "d/m/Y");
     $current_user->setPreference('timef', "H:i:s");
     $current_user->setPreference('timezone', "Europe/Rome");
     // new object to avoid TZ caching
     $this->timedate = new TimeDate();
     $this->meetingsArr = array();
     // Create a Bunch of Meetings
     $d = 12;
     $cnt = 0;
     while ($d < 15) {
         $this->meetingsArr[$cnt] = new Meeting();
         $this->meetingsArr[$cnt]->name = 'Bug45287 Meeting ' . ($cnt + 1);
         $this->meetingsArr[$cnt]->date_start = $this->timedate->to_display_date_time(gmdate("Y-m-d H:i:s", mktime(10 + $cnt, 30, 00, 7, $d, 2011)));
         $this->meetingsArr[$cnt]->save();
         $d++;
         $cnt++;
     }
     $this->searchDefs = array("Meetings" => array("layout" => array("basic_search" => array("name" => array("name" => "name", "default" => true, "width" => "10%"), "date_start" => array("name" => "date_start", "default" => true, "width" => "10%", "type" => "datetimecombo")))));
     $this->searchFields = array("Meetings" => array("name" => array("query_type" => "default"), "date_start" => array("query_type" => "default"), "range_date_start" => array("query_type" => "default", "enable_range_search" => 1, "is_date_field" => 1), "range_date_start" => array("query_type" => "default", "enable_range_search" => 1, "is_date_field" => 1), "start_range_date_start" => array("query_type" => "default", "enable_range_search" => 1, "is_date_field" => 1), "end_range_date_start" => array("query_type" => "default", "enable_range_search" => 1, "is_date_field" => 1)));
 }
 public static function setUpBeforeClass()
 {
     $GLOBALS['current_user'] = SugarTestUserUtilities::createAnonymousUser();
     // clean up queue
     $GLOBALS['db']->query("DELETE FROM job_queue WHERE status='queued'");
     $GLOBALS['sugar_config']['job_server'] = "http://test.job.server/";
 }
 public function setUp()
 {
     $GLOBALS['current_user'] = SugarTestUserUtilities::createAnonymousUser();
     $this->account = SugarTestAccountUtilities::createAccount();
     $this->account->name = "SDizzle Inc";
     $this->account->save();
 }
 public function setUp()
 {
     $beanList = array();
     $beanFiles = array();
     require 'include/modules.php';
     $GLOBALS['beanList'] = $beanList;
     $GLOBALS['beanFiles'] = $beanFiles;
     //Reload langauge strings
     $GLOBALS['app_strings'] = return_application_language($GLOBALS['current_language']);
     $GLOBALS['app_list_strings'] = return_app_list_strings_language($GLOBALS['current_language']);
     $GLOBALS['mod_strings'] = return_module_language($GLOBALS['current_language'], 'Accounts');
     //Create an anonymous user for login purposes/
     $this->_user = SugarTestUserUtilities::createAnonymousUser();
     $this->_admin_user = SugarTestUserUtilities::createAnonymousUser();
     $this->_admin_user->status = 'Active';
     $this->_admin_user->is_admin = 1;
     $this->_admin_user->save();
     $GLOBALS['db']->commit();
     // Making sure we commit any changes before continuing
     $GLOBALS['current_user'] = $this->_user;
     self::$helperObject = new APIv3Helper();
     //Disable access to the website field.
     $this->aclRole = new ACLRole();
     $this->aclRole->name = "Unit Test";
     $this->aclRole->save();
     $GLOBALS['db']->commit();
     // Making sure we commit any changes before continuing
     $this->aclRole->set_relationship('acl_roles_users', array('role_id' => $this->aclRole->id, 'user_id' => $this->_user->id), false);
     $GLOBALS['db']->commit();
     // Making sure we commit any changes before continuing
 }
Exemple #9
0
 public function setUp()
 {
     $GLOBALS['current_user'] = SugarTestUserUtilities::createAnonymousUser();
     $this->user = $GLOBALS['current_user'];
     $this->user->setPreference('default_decimal_seperator', '.');
     $this->loc = new Localization();
 }
Exemple #10
0
 /**
  * Sets up the fixture, for example, open a network connection.
  * This method is called before a test is executed.
  *
  * @return void
  */
 public function setUp()
 {
     $this->markTestIncomplete("Disabling broken test on CI. Working with Sergei to get it fixed");
     $GLOBALS['current_user'] = SugarTestUserUtilities::createAnonymousUser(true, true);
     // add an extra relationship that will be used for search
     self::registerExtension('Contacts', 'bug51596test.php', array('Contact' => array('fields' => array($this->field_name => array('name' => $this->field_name, 'rname' => 'name', 'id_name' => 'account_id', 'join_name' => 'accounts', 'type' => 'relate', 'link' => 'accounts', 'table' => 'accounts', 'module' => 'Accounts', 'source' => 'non-db')))));
     // this is needed for newly created extension to be loaded for new beans
     $_SESSION['developerMode'] = true;
     // create a set of contacts and related accounts
     $this->contact1 = new Contact();
     $this->contact1->do_not_call = 0;
     $this->contact1->save();
     $this->contact2 = new Contact();
     $this->contact2->do_not_call = 0;
     $this->contact2->save();
     $this->account1 = new Account();
     $this->account1->name = 'Bug51596Test_Account1';
     $this->account1->save();
     $this->account2 = new Account();
     $this->account2->name = 'Bug51596Test_Account2';
     $this->account2->save();
     $this->contact1->load_relationship('accounts');
     $this->contact2->load_relationship('accounts');
     /** @var Link2 $accounts1 */
     $accounts1 = $this->contact1->accounts;
     $accounts1->add(array($this->account1->id));
     /** @var Link2 $accounts2 */
     $accounts2 = $this->contact2->accounts;
     $accounts2->add(array($this->account2->id));
     // will update "do_not_call" attribute of found contacts
     $_REQUEST['massupdate'] = 'true';
     $_REQUEST['entire'] = true;
     $_REQUEST['module'] = 'Contacts';
     $_POST['do_not_call'] = 1;
 }
 public function setUp()
 {
     $GLOBALS['current_user'] = SugarTestUserUtilities::createAnonymousUser();
     $this->_goodFile = SugarTestImportUtilities::createFile(2000, 3);
     $this->_badFile = ImportCacheFiles::getImportDir() . '/thisfileisntthere' . date("YmdHis");
     $this->_whiteSpaceFile = SugarTestImportUtilities::createFileWithWhiteSpace();
 }
Exemple #12
0
 public function setUp()
 {
     global $mod_strings;
     $mod_strings = return_module_language($GLOBALS['current_language'], 'Leads');
     $GLOBALS['current_user'] = SugarTestUserUtilities::createAnonymousUser(true, 1);
     $GLOBALS['app_list_strings'] = return_app_list_strings_language($GLOBALS['current_language']);
 }
Exemple #13
0
 public function setUp()
 {
     SugarTestHelper::setUp('mod_strings', array('ModuleBuilder'));
     $GLOBALS['current_user'] = SugarTestUserUtilities::createAnonymousUser();
     $_SESSION['authenticated_user_language'] = 'en_us';
     $_REQUEST['dropdown_name'] = 'testDD';
 }
Exemple #14
0
 /**
  * Sets up the fixture, for example, open a network connection.
  * This method is called before a test is executed.
  *
  * Creates a temporary opportunity
  */
 public function setUp()
 {
     $GLOBALS['current_user'] = SugarTestUserUtilities::createAnonymousUser();
     $this->opportunity = new Opportunity();
     $this->opportunity->currency_id = -99;
     $this->opportunity->save();
 }
Exemple #15
0
 public function setUp()
 {
     $this->markTestIncomplete('SugarTestCampaignUtilities does not exist');
     $GLOBALS['current_user'] = SugarTestUserUtilities::createAnonymousUser();
     $campaign = SugarTestCampaignUtilities::createCampaign();
     $this->campaign_id = $campaign->id;
 }
 public function setUp()
 {
     global $current_user;
     $this->_soapURL = $GLOBALS['sugar_config']['site_url'] . '/soap.php';
     //Clean up any possible contacts not deleted
     $GLOBALS['db']->query("DELETE FROM contacts WHERE first_name = 'NoBlankFieldUpdate' AND last_name = 'OnFirstSyncTest'");
     $current_user = SugarTestUserUtilities::createAnonymousUser();
     $contact = SugarTestContactUtilities::createContact();
     $contact->first_name = 'NoBlankFieldUpdate';
     $contact->last_name = 'OnFirstSyncTest';
     $contact->phone_mobile = '867-5309';
     $contact->email1 = '*****@*****.**';
     $contact->title = 'Jenny - I Got Your Number';
     $contact->disable_custom_fields = true;
     $contact->save();
     $this->c = $contact;
     $GLOBALS['db']->query("DELETE FROM contacts WHERE first_name = 'Collin' AND last_name = 'Lee'");
     //Manually create a contact entry
     $contact2 = new Contact();
     $contact2->title = 'Jenny - I Got Your Number';
     $contact2->first_name = 'Collin';
     $contact2->last_name = 'Lee';
     $contact2->phone_mobile = '867-5309';
     $contact2->disable_custom_fields = true;
     $contact2->email1 = '';
     $contact2->email2 = '';
     $contact2->save();
     $this->c2 = $contact2;
     //DELETE contact_users entries that may have remained
     $GLOBALS['db']->query("DELETE FROM contacts_users WHERE user_id = '{$current_user->id}'");
     parent::setUp();
     $GLOBALS['db']->commit();
 }
 public function setUp()
 {
     $GLOBALS['current_user'] = SugarTestUserUtilities::createAnonymousUser();
     $GLOBALS['current_user']->setPreference('timezone', "America/Los_Angeles");
     $GLOBALS['current_user']->setPreference('datef', "m/d/Y");
     $GLOBALS['current_user']->setPreference('timef', "h.iA");
 }
 public function setup()
 {
     global $current_user;
     $current_user = SugarTestUserUtilities::createAnonymousUser();
     //for the purpose of this test, we need to create a campaign and relate it to a campaign tracker object
     //create campaign
     $c = new Campaign();
     $c->name = 'CT test ' . time();
     $c->campaign_type = 'Email';
     $c->status = 'Active';
     $timeDate = new TimeDate();
     $c->end_date = $timeDate->to_display_date(date('Y') + 1 . '-01-01');
     $c->assigned_id = $current_user->id;
     $c->team_id = '1';
     $c->team_set_id = '1';
     $c->save();
     $this->campaign = $c;
     //create campaign tracker
     $ct = new CampaignTracker();
     $ct->tracker_name = 'CampaignTrackerTest' . time();
     $ct->tracker_url = 'sugarcrm.com';
     $ct->campaign_id = $this->campaign->id;
     $ct->save();
     $this->campaign_tracker = $ct;
 }
Exemple #19
0
 public function setUp()
 {
     $this->markTestIncomplete("Disabling after discussing with Eddy.  Eddy will take a look at why this is breaking Stack 66 build");
     //create user
     $this->user = SugarTestUserUtilities::createAnonymousUser();
     $this->user->default_team_name = 'global';
     $this->user->is_admin = 1;
     $this->user->save();
     $this->user->retrieve($this->user->id);
     $GLOBALS['current_user'] = $this->user;
     //set some global values that will help with the view
     $_REQUEST['action'] = $GLOBALS['action'] = 'DetailView';
     $_REQUEST['module'] = $GLOBALS['module'] = 'Opportunities';
     $GLOBALS['app_strings'] = return_application_language($GLOBALS['current_language']);
     $GLOBALS['mod_strings'] = return_module_language($GLOBALS['current_language'], "Opportunities");
     //create opportunity
     $name = 'Test_51980_' . time();
     $this->opp = new Opportunity();
     $this->opp->name = $name;
     $this->opp->amount = '1000000';
     $this->opp->account_id = '1';
     $this->opp->team_id = '1';
     $this->opp->currency_id = -99;
     $this->opp->save();
 }
 public function setUp()
 {
     $GLOBALS['current_user'] = SugarTestUserUtilities::createAnonymousUser();
     $this->_goodFile = SugarTestImportUtilities::createFile();
     $this->_badFile = $GLOBALS['sugar_config']['import_dir'] . 'thisfileisntthere' . date("YmdHis");
     $this->_whiteSpaceFile = SugarTestImportUtilities::createFileWithWhiteSpace();
 }
 public function setUp()
 {
     $GLOBALS['current_user'] = SugarTestUserUtilities::createAnonymousUser();
     $GLOBALS['app_strings'] = return_application_language($GLOBALS['current_language']);
     $acc = new Account();
     $this->form = new SearchFormMock($acc, "Accounts");
 }
Exemple #22
0
 public function setUp()
 {
     global $current_user;
     $current_user = SugarTestUserUtilities::createAnonymousUser();
     $this->call = SugarTestCallUtilities::createCall();
     $this->useOutputBuffering = false;
 }
 public function setUp()
 {
     global $moduleList, $beanList, $beanFiles;
     require 'include/modules.php';
     $GLOBALS['current_user'] = SugarTestUserUtilities::createAnonymousUser();
     $this->bean = new Contact();
 }
Exemple #24
0
 public function setUp()
 {
     global $current_user, $currentModule;
     $mod_strings = return_module_language($GLOBALS['current_language'], "Contacts");
     $current_user = SugarTestUserUtilities::createAnonymousUser();
     $unid = uniqid();
     $time = date('Y-m-d H:i:s');
     $contact = new Contact();
     $contact->id = 'c_' . $unid;
     $contact->first_name = 'testfirst';
     $contact->last_name = 'testlast';
     $contact->new_with_id = true;
     $contact->disable_custom_fields = true;
     $contact->save();
     $this->c = $contact;
     $account = new Account();
     $account->id = 'a_' . $unid;
     $account->first_name = 'testfirst';
     $account->last_name = 'testlast';
     $account->assigned_user_id = 'SugarUser';
     $account->new_with_id = true;
     $account->disable_custom_fields = true;
     $account->save();
     $this->a = $account;
     $ac_id = 'ac_' . $unid;
     $this->ac_id = $ac_id;
     $GLOBALS['db']->query("insert into accounts_contacts (id , contact_id, account_id, date_modified, deleted) values ('{$ac_id}', '{$contact->id}', '{$account->id}', '{$time}', 0)");
 }
Exemple #25
0
 public function setUp()
 {
     $GLOBALS['current_user'] = SugarTestUserUtilities::createAnonymousUser();
     $this->_account = new Account();
     $this->_account->name = 'Account_' . create_guid();
     $this->_account->save();
 }
Exemple #26
0
 public function setUp()
 {
     $GLOBALS['current_user'] = SugarTestUserUtilities::createAnonymousUser();
     $GLOBALS['current_user']->is_admin = '1';
     // email_xss settings to be saved using config_override
     $this->email_xss = array('applet' => 'applet', 'form' => 'form', 'iframe' => 'iframe', 'script' => 'script');
 }
Exemple #27
0
 public function setUp()
 {
     global $current_user, $currentModule;
     global $beanList;
     require 'include/modules.php';
     $current_user = SugarTestUserUtilities::createAnonymousUser();
     $unid = uniqid();
     $time = date('Y-m-d H:i:s');
     $contact = new Contact();
     $contact->id = 'c_' . $unid;
     $contact->first_name = 'testfirst';
     $contact->last_name = 'testlast';
     $contact->new_with_id = true;
     $contact->disable_custom_fields = true;
     $contact->save();
     $this->contact = $contact;
     $account = new Account();
     $account->id = 'a_' . $unid;
     $account->first_name = 'testfirst';
     $account->last_name = 'testlast';
     $account->assigned_user_id = 'SugarUser';
     $account->new_with_id = true;
     $account->disable_custom_fields = true;
     $account->save();
     $this->account = $account;
     $ac_id = 'ac_' . $unid;
     $this->ac_id = $ac_id;
     //Accounts to Contacts
     $GLOBALS['db']->query("INSERT INTO accounts_contacts (id , contact_id, account_id, date_modified, deleted) values ('{$ac_id}', '{$contact->id}', '{$account->id}', '{$time}', 0)");
     $_REQUEST['relate_id'] = $this->contact->id;
     $_REQUEST['relate_to'] = 'projects_contacts';
 }
Exemple #28
0
 public function setUp()
 {
     global $current_user, $currentModule;
     $this->_user = SugarTestUserUtilities::createAnonymousUser();
     $GLOBALS['db']->query("DELETE FROM folders_subscriptions WHERE assigned_user_id='{$this->_user->id}'");
     $this->folder = new SugarFolder();
 }
Exemple #29
0
 public function setUp()
 {
     global $current_user, $currentModule;
     $this->_user = SugarTestUserUtilities::createAnonymousUser();
     $GLOBALS['current_user'] = $this->_user;
     $this->folder = new SugarFolder();
 }
 public function setUp()
 {
     global $beanList, $beanFiles;
     include 'include/modules.php';
     //Reload langauge strings
     $GLOBALS['app_strings'] = return_application_language($GLOBALS['current_language']);
     $GLOBALS['app_list_strings'] = return_app_list_strings_language($GLOBALS['current_language']);
     $GLOBALS['mod_strings'] = return_module_language($GLOBALS['current_language'], 'Accounts');
     //Create an anonymous user for login purposes/
     $this->_user = SugarTestUserUtilities::createAnonymousUser();
     $GLOBALS['current_user'] = $this->_user;
     self::$helperObject = new APIv3Helper();
     if (file_exists(sugar_cached('modules/unified_search_modules.php'))) {
         $this->unified_search_modules_content = file_get_contents(sugar_cached('modules/unified_search_modules.php'));
         unlink(sugar_cached('modules/unified_search_modules.php'));
     }
     require_once 'modules/Home/UnifiedSearchAdvanced.php';
     $unifiedSearchAdvanced = new UnifiedSearchAdvanced();
     $_REQUEST['enabled_modules'] = 'Accounts,Contacts,Opportunities';
     $unifiedSearchAdvanced->saveGlobalSearchSettings();
     $GLOBALS['db']->query("DELETE FROM accounts WHERE name like 'UNIT TEST%' ");
     $GLOBALS['db']->query("DELETE FROM opportunities WHERE name like 'UNIT TEST%' ");
     $GLOBALS['db']->query("DELETE FROM contacts WHERE first_name like 'UNIT TEST%' ");
     $GLOBALS['db']->query("DELETE FROM calls WHERE name like 'UNIT TEST%' ");
     $GLOBALS['db']->query("DELETE FROM tasks WHERE name like 'UNIT TEST%' ");
     $GLOBALS['db']->query("DELETE FROM meetings WHERE name like 'UNIT TEST%' ");
     $GLOBALS['db']->commit();
     //$this->useOutputBuffering = false;
 }