public function tearDown()
 {
     $GLOBALS['db']->query("DELETE FROM email_addr_bean_rel WHERE bean_id = '{$this->_cleanId}' AND bean_module = '{$this->_importObject->module_dir}'");
     $GLOBALS['db']->query("DELETE FROM email_addresses WHERE email_address IN ('*****@*****.**', '*****@*****.**', '*****@*****.**')");
     $GLOBALS['db']->query("DELETE FROM {$this->_importObject->table_name} WHERE created_by = '{$GLOBALS['current_user']->id}'");
     SugarTestHelper::tearDown();
 }
Esempio n. 2
0
 public function tearDown()
 {
     SugarTestCallUtilities::removeAllCreatedCalls();
     SugarTestMeetingUtilities::removeAllCreatedMeetings();
     SugarTestTaskUtilities::removeAllCreatedTasks();
     SugarTestHelper::tearDown();
 }
Esempio n. 3
0
 public function tearDown()
 {
     unset($_REQUEST['dropdown_name']);
     unset($_SESSION['authenticated_user_language']);
     SugarTestUserUtilities::removeAllCreatedAnonymousUsers();
     SugarTestHelper::tearDown();
 }
Esempio n. 4
0
 public function tearDown()
 {
     $GLOBALS['db']->query("DELETE FROM folders_subscriptions WHERE assigned_user_id='{$GLOBALS['current_user']->id}'");
     $GLOBALS['db']->query("DELETE FROM folders WHERE created_by='{$GLOBALS['current_user']->id}' OR name='Bug62883Test'");
     $GLOBALS['db']->query("DELETE FROM folders_subscriptions WHERE assigned_user_id='{$GLOBALS['current_user']->id}'");
     SugarTestHelper::tearDown();
 }
Esempio n. 5
0
 public function tearDown()
 {
     SugarTestHelper::tearDown();
     SugarTestAccountUtilities::removeAllCreatedAccounts();
     SugarTestContactUtilities::removeAllCreatedContacts();
     SugarTestLeadUtilities::removeAllCreatedLeads();
 }
Esempio n. 6
0
 public function tearDown()
 {
     SugarTestAccountUtilities::removeAllCreatedAccounts();
     SugarTestContactUtilities::removeAllCreatedContacts();
     SugarTestUserUtilities::removeAllCreatedAnonymousUsers();
     SugarTestHelper::tearDown();
 }
Esempio n. 7
0
 public function tearDown()
 {
     $GLOBALS['db']->query('DELETE FROM opportunities WHERE id = \'' . $this->opportunities->id . '\' ');
     unset($this->opportunities);
     SugarTestUserUtilities::removeAllCreatedAnonymousUsers();
     SugarTestHelper::tearDown();
 }
 /**
  * Create a relationship
  *
  * Params should be passed in as this:
  *
  * array(
  *       'relationship_type' => 'one-to-many',
  *       'lhs_module' => 'Accounts',
  *       'rhs_module' => 'Accounts',
  *   )
  *
  * @static
  * @param array $relationship_def
  * @return ActivitiesRelationship|bool|ManyToManyRelationship|ManyToOneRelationship|OneToManyRelationship|OneToOneRelationship
  */
 public static function createRelationship(array $relationship_def)
 {
     if (!self::checkRequiredFields($relationship_def)) {
         return false;
     }
     $relationships = new DeployedRelationships($relationship_def['lhs_module']);
     if (!isset($relationship_def['view_module'])) {
         $relationship_def['view_module'] = $relationship_def['lhs_module'];
     }
     $REQUEST_Backup = $_REQUEST;
     $_REQUEST = $relationship_def;
     $relationship = $relationships->addFromPost();
     $relationships->save();
     $relationships->build();
     LanguageManager::clearLanguageCache($relationship_def['lhs_module']);
     SugarRelationshipFactory::rebuildCache();
     // rebuild the dictionary to make sure that it has the new relationship in it
     SugarTestHelper::setUp('dictionary');
     // reset the link fields since we added one
     VardefManager::$linkFields = array();
     $_REQUEST = $REQUEST_Backup;
     unset($REQUEST_Backup);
     self::$_relsAdded[] = $relationship->getDefinition();
     return $relationship;
 }
 public function tearDown()
 {
     SugarTestHelper::tearDown();
     $GLOBALS['db']->query("DELETE FROM contacts WHERE id= '{$this->_contact->id}'");
     unset($this->_contact);
     if ($this->_hasUnifiedSearchModulesConfig) {
         copy(sugar_cached('modules/unified_search_modules.php.bak'), sugar_cached('modules/unified_search_modules.php'));
         unlink(sugar_cached('modules/unified_search_modules.php.bak'));
     } else {
         unlink(sugar_cached('modules/unified_search_modules.php'));
     }
     if ($this->_hasUnifiedSearchModulesDisplay) {
         copy('custom/modules/unified_search_modules_display.php.bak', 'custom/modules/unified_search_modules_display.php');
         unlink('custom/modules/unified_search_modules_display.php.bak');
     } else {
         unlink('custom/modules/unified_search_modules_display.php');
     }
     SugarTestUserUtilities::removeAllCreatedAnonymousUsers();
     if (isset($_REQUEST['module'])) {
         unset($_REQUEST['module']);
     }
     if (isset($_REQUEST['query_string'])) {
         unset($_REQUEST['query_string']);
     }
     if (isset($_REQUEST['enabled_modules'])) {
         unset($_REQUEST['enabled_modules']);
     }
 }
Esempio n. 10
0
 public function tearDown()
 {
     SugarTestUserUtilities::removeAllCreatedAnonymousUsers();
     unset($GLOBALS['current_user']);
     SugarTestAccountUtilities::removeAllCreatedAccounts();
     SugarTestHelper::tearDown();
 }
Esempio n. 11
0
 public function tearDown()
 {
     $this->relateField->delete($this->df);
     $this->rc->repairAndClearAll(array("rebuildExtensions", "clearVardefs"), array("Contact"), false, false);
     SugarTestAccountUtilities::removeAllCreatedAccounts();
     SugarTestContactUtilities::removeAllCreatedContacts();
     SugarTestHelper::tearDown();
 }
Esempio n. 12
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();
 }
Esempio n. 13
0
 public function tearDown()
 {
     $_POST = array();
     $this->bean->db->query("DELETE FROM meetings WHERE id = '" . $this->bean->id . "'");
     $this->bean->db->query("DELETE FROM {$this->bean->rel_users_table} WHERE meeting_id = '" . $this->bean->id . "'");
     parent::tearDown();
     SugarTestHelper::tearDown();
 }
Esempio n. 14
0
 public function tearDown()
 {
     foreach ($this->_createdBeans as $bean) {
         $bean->retrieve($bean->id);
         $bean->mark_deleted($bean->id);
     }
     SugarTestHelper::tearDown();
 }
Esempio n. 15
0
 public function tearDown()
 {
     SugarTestAccountUtilities::removeAllCreatedAccounts();
     SugarTestContactUtilities::removeAllCreatedContacts();
     parent::tearDown();
     parent::_tearDownTestUser();
     SugarTestHelper::tearDown();
 }
Esempio n. 16
0
 public function tearDown()
 {
     if (!empty($this->id)) {
         $job = new SchedulersJob();
         $job->mark_deleted($this->id);
     }
     SugarTestHelper::tearDown();
 }
Esempio n. 17
0
 public function tearDown()
 {
     // Clean the Contacts created using vCard Import
     foreach ($this->createdContacts as $contactId) {
         $GLOBALS['db']->query("DELETE FROM contacts WHERE id = '{$contactId}'");
     }
     unlink($this->filename);
     SugarTestHelper::tearDown();
 }
Esempio n. 18
0
 function tearDown()
 {
     //remove connector file
     unlink($this->custom_path . '/connectors.php');
     if (!empty($this->custom_contents)) {
         file_put_contents($this->custom_path . '/connectors.php', $this->custom_contents);
     }
     SugarTestHelper::tearDown();
 }
Esempio n. 19
0
 public function tearDown()
 {
     SugarTestHelper::tearDown();
     SugarTestOpportunityUtilities::removeAllCreatedOpportunities();
     SugarTestEmailUtilities::removeAllCreatedEmails();
     SugarTestContactUtilities::removeAllCreatedContacts();
     SugarTestAccountUtilities::removeAllCreatedAccounts();
     $GLOBALS['app'] = $this->application;
 }
Esempio n. 20
0
 public function tearDown()
 {
     $GLOBALS["db"]->query("DELETE FROM inbound_email WHERE id = '{$this->ie->id}'");
     $GLOBALS["db"]->query("DELETE FROM cases WHERE name = '{$this->ie->casename}'");
     SugarTestAccountUtilities::removeAllCreatedAccounts();
     SugarTestContactUtilities::removeCreatedContactsEmailAddresses();
     SugarTestContactUtilities::removeAllCreatedContacts();
     SugarTestHelper::tearDown();
 }
Esempio n. 21
0
 protected function tearDown()
 {
     SugarTestContactUtilities::removeAllCreatedContacts();
     SugarTestContactUtilities::removeCreatedContactsEmailAddresses();
     SugarTestContactUtilities::removeCreatedContactsUsersRelationships();
     SugarTestMeetingUtilities::removeAllCreatedMeetings();
     SugarTestMeetingUtilities::removeMeetingContacts();
     SugarTestMeetingUtilities::removeMeetingUsers();
     SugarTestHelper::tearDown();
 }
Esempio n. 22
0
 public function tearDown()
 {
     /** @var DBManager */
     global $db;
     if ($this->case && $this->case->id) {
         $query = 'DELETE FROM cases where id = ' . $db->quoted($this->case->id);
         $db->query($query);
     }
     SugarTestHelper::tearDown();
 }
Esempio n. 23
0
 public function tearDown()
 {
     if ($this->accountFieldWidget) {
         $this->accountFieldWidget->delete($this->accountField);
     }
     if ($this->opportunityFieldWidget) {
         $this->opportunityFieldWidget->delete($this->opportunityField);
     }
     $repair = new RepairAndClear();
     $repair->repairAndClearAll(array('rebuildExtensions', 'clearVardefs'), array($GLOBALS['beanList']['Accounts'], $GLOBALS['beanList']['Opportunities']), true, false);
     $_REQUEST = $_POST = array();
     SugarTestHelper::tearDown();
 }
Esempio n. 24
0
 public function tearDown()
 {
     foreach ($this->meetingsArr as $m) {
         $GLOBALS['db']->query('DELETE FROM meetings WHERE id = \'' . $m->id . '\' ');
     }
     unset($m);
     unset($this->meetingsArr);
     unset($this->searchDefs);
     unset($this->searchFields);
     unset($this->timedate);
     SugarTestUserUtilities::removeAllCreatedAnonymousUsers();
     SugarTestHelper::tearDown();
 }
Esempio n. 25
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();
 }
Esempio n. 26
0
 public function tearDown()
 {
     $this->custField->delete($this->df);
     $_REQUEST['repair_silent'] = 1;
     $rc = new RepairAndClear();
     $rc->repairAndClearAll(array("clearAll", "rebuildExtensions"), array("Accounts"), false, false);
     SugarTestUserUtilities::removeAllCreatedAnonymousUsers();
     SugarTestAccountUtilities::removeAllCreatedAccounts();
     SugarTestHelper::tearDown();
     $GLOBALS['reload_vardefs'] = true;
     $o = new Account();
     $GLOBALS['reload_vardefs'] = false;
 }
Esempio n. 27
0
 public function setUp()
 {
     global $sugar_config;
     SugarTestHelper::setUp('beanFiles');
     SugarTestHelper::setUp('beanList');
     SugarTestHelper::setUp('current_user', array(true, 1));
     SugarTestHelper::setUp('app_list_strings');
     SugarTestHelper::setUp('app_strings');
     $sugar_config['disable_count_query'] = true;
     for ($i = 0; $i < 3; $i++) {
         SugarTestAccountUtilities::createAccount();
     }
     $this->query = "SELECT accounts.*  FROM accounts WHERE 1=1";
 }
Esempio n. 28
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']);
     $_REQUEST = array();
     SugarCache::$isCacheReset = false;
     SugarTestHelper::tearDown();
 }
Esempio n. 29
0
 public function tearDown()
 {
     $GLOBALS['db']->query("DELETE FROM saved_reports WHERE id = '{$this->_report->saved_report->id}'");
     SugarTestOpportunityUtilities::removeAllCreatedOpportunities();
     SugarTestHelper::tearDown();
 }
Esempio n. 30
0
 public function tearDown()
 {
     SugarTestHelper::tearDown();
 }