/** * @group bug45187 */ public function testActivityModuleLabel() { global $sugar_config; global $app_list_strings; // init $lead = SugarTestLeadUtilities::createLead(); $account = SugarTestAccountUtilities::createAccount(); // simulate module renaming $org_name = $app_list_strings['moduleListSingular']['Contacts']; $app_list_strings['moduleListSingular']['Contacts'] = 'People'; // set the request/post parameters before converting the lead $_REQUEST['module'] = 'Leads'; $_REQUEST['action'] = 'ConvertLead'; $_REQUEST['record'] = $lead->id; unset($_REQUEST['handle']); $_REQUEST['selectedAccount'] = $account->id; $sugar_config['lead_conv_activity_opt'] = 'move'; // call display to trigger conversion $vc = new ViewConvertLead(); $vc->init($lead); $vc->display(); // the activity options dropdown should use the renamed module label $this->expectOutputRegex('/.*People<\\/OPTION>.*/'); // cleanup $app_list_strings['moduleListSingular']['Contacts'] = $org_name; unset($_REQUEST['module']); unset($_REQUEST['action']); unset($_REQUEST['record']); unset($_REQUEST['selectedAccount']); SugarTestAccountUtilities::removeAllCreatedAccounts(); SugarTestLeadUtilities::removeAllCreatedLeads(); }
public function tearDown() { SugarTestAccountUtilities::removeAllCreatedAccounts(); SugarTestContactUtilities::removeAllCreatedContacts(); SugarTestUserUtilities::removeAllCreatedAnonymousUsers(); SugarTestHelper::tearDown(); }
public function tearDown() { SugarTestUserUtilities::removeAllCreatedAnonymousUsers(); unset($GLOBALS['current_user']); SugarTestAccountUtilities::removeAllCreatedAccounts(); SugarTestHelper::tearDown(); }
public function tearDown() { SugarTestHelper::tearDown(); SugarTestAccountUtilities::removeAllCreatedAccounts(); SugarTestContactUtilities::removeAllCreatedContacts(); SugarTestLeadUtilities::removeAllCreatedLeads(); }
public function tearDown() { SugarTestAccountUtilities::removeAllCreatedAccounts(); SugarTestContactUtilities::removeAllCreatedContacts(); parent::tearDown(); parent::_tearDownTestUser(); SugarTestHelper::tearDown(); }
public static function tearDownAfterClass() { SugarTestUserUtilities::removeAllCreatedAnonymousUsers(); SugarTestContactUtilities::removeAllCreatedContacts(); SugarTestAccountUtilities::removeAllCreatedAccounts(); unset($GLOBALS['current_user']); $GLOBALS['db']->commit(); }
public function tearDown() { $this->relateField->delete($this->df); $this->rc->repairAndClearAll(array("rebuildExtensions", "clearVardefs"), array("Contact"), false, false); SugarTestAccountUtilities::removeAllCreatedAccounts(); SugarTestContactUtilities::removeAllCreatedContacts(); SugarTestHelper::tearDown(); }
/** * 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(); }
public function tearDown() { if ($this->email_id) { $GLOBALS['db']->query("delete from emails where id='{$this->email_id}'"); } SugarTestAccountUtilities::removeAllCreatedAccounts(); SugarTestUserUtilities::removeAllCreatedAnonymousUsers(); unset($GLOBALS['current_user']); }
public function tearDown() { SugarTestHelper::tearDown(); SugarTestOpportunityUtilities::removeAllCreatedOpportunities(); SugarTestEmailUtilities::removeAllCreatedEmails(); SugarTestContactUtilities::removeAllCreatedContacts(); SugarTestAccountUtilities::removeAllCreatedAccounts(); $GLOBALS['app'] = $this->application; }
public function tearDown() { SugarTestUserUtilities::removeAllCreatedAnonymousUsers(); SugarTestContactUtilities::removeAllCreatedContacts(); SugarTestAccountUtilities::removeAllCreatedAccounts(); SugarTestTrackerUtility::removeAllTrackerEntries(); unset($GLOBALS['current_user']); unset($GLOBALS['app_strings']); }
/** * Remove anything that was used during this test * */ public function tearDown() { parent::tearDown(); SugarTestAccountUtilities::removeAllCreatedAccounts(); global $soap_version_test_accountId, $soap_version_test_opportunityId, $soap_version_test_contactId; unset($soap_version_test_accountId); unset($soap_version_test_opportunityId); unset($soap_version_test_contactId); }
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(); }
/** * Remove anything that was used during this test * */ public function tearDown() { $this->_tearDownTestUser(); $this->_user = null; $this->_sessionId = ''; unset($GLOBALS['beanList']); unset($GLOBALS['beanFiles']); SugarTestAccountUtilities::removeAllCreatedAccounts(); SugarTestContactUtilities::removeAllCreatedContacts(); }
public function tearDown() { SugarTestAccountUtilities::removeAllCreatedAccounts(); unset($this->account); unset($GLOBALS['tabStructure']); unset($this->subPanel, $this->group_label); unset($GLOBALS['dictionary']["accounts_cases_10000"]); SugarTestUserUtilities::removeAllCreatedAnonymousUsers(); unset($GLOBALS['current_user']); unset($GLOBALS['beanFiles']); unset($GLOBALS['beanList']); }
public function testGetNamePlusEmailAddressesForComposeMultipleIds() { $account1 = SugarTestAccountUtilities::createAccount(); $account2 = SugarTestAccountUtilities::createAccount(); $account3 = SugarTestAccountUtilities::createAccount(); $email = new Email(); $addressString = $email->getNamePlusEmailAddressesForCompose('Accounts', array($account1->id, $account2->id, $account3->id)); $this->assertContains("{$account1->name} <{$account1->email1}>", $addressString); $this->assertContains("{$account2->name} <{$account2->email1}>", $addressString); $this->assertContains("{$account3->name} <{$account3->email1}>", $addressString); SugarTestAccountUtilities::removeAllCreatedAccounts(); }
public function tearDown() { foreach (SugarTestContactUtilities::getCreatedContactIds() as $id) { $GLOBALS['db']->query("DELETE FROM accounts_contacts WHERE contact_id = '{$id}'"); } SugarTestContactUtilities::removeAllCreatedContacts(); SugarTestAccountUtilities::removeAllCreatedAccounts(); SugarTestUserUtilities::removeAllCreatedAnonymousUsers(); unset($GLOBALS['current_user']); unset($GLOBALS['beanList']); unset($GLOBALS['beanFiles']); }
public function tearDown() { if (!empty($this->jobs)) { $jobs = implode("','", $this->jobs); $this->db->query("DELETE FROM job_queue WHERE id IN ('{$jobs}')"); } SugarTestUserUtilities::removeAllCreatedAnonymousUsers(); $ids = SugarTestAccountUtilities::getCreatedAccountIds(); if (!empty($ids)) { SugarTestAccountUtilities::removeAllCreatedAccounts(); } }
public function tearDown() { SugarTestUserUtilities::removeAllCreatedAnonymousUsers(); unset($GLOBALS['current_user']); if (!empty($this->email_id)) { $GLOBALS['db']->query("DELETE FROM emails WHERE id='{$this->email_id}'"); $GLOBALS['db']->query("DELETE FROM emails_beans WHERE email_id='{$this->email_id}'"); $GLOBALS['db']->query("DELETE FROM emails_text WHERE email_id='{$this->email_id}'"); $GLOBALS['db']->query("DELETE FROM emails_email_addr_rel WHERE email_id='{$this->email_id}'"); } SugarTestAccountUtilities::removeAllCreatedAccounts(); parent::tearDown(); }
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; }
public function testAuditForRelatedFields() { $test_account_name = 'test account name after'; $account = SugarTestAccountUtilities::createAccount(); $this->obj->field_defs['account_name']['audited'] = 1; $this->obj->name = 'test'; $this->obj->account_id = $account->id; $this->obj->save(); $this->obj->retrieve(); $this->obj->account_name = $test_account_name; $changes = $this->obj->db->getAuditDataChanges($this->obj); $this->assertEquals($changes['account_name']['after'], $test_account_name); SugarTestAccountUtilities::removeAllCreatedAccounts(); }
public function tearDown() { SugarTestUserUtilities::removeAllCreatedAnonymousUsers(); unset($GLOBALS['current_user']); if (file_exists($GLOBALS['sugar_config']['cache_dir'] . 'modules/unified_search_modules.php.bak')) { copy($GLOBALS['sugar_config']['cache_dir'] . 'modules/unified_search_modules.php.bak', $GLOBALS['sugar_config']['cache_dir'] . 'modules/unified_search_modules.php'); unlink($GLOBALS['sugar_config']['cache_dir'] . 'modules/unified_search_modules.php.bak'); } if (file_exists('custom/modules/unified_search_modules_display.php.bak')) { 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'); } SugarTestTaskUtilities::removeAllCreatedTasks(); SugarTestAccountUtilities::removeAllCreatedAccounts(); }
public function tearDown() { $this->df->deleteField($this->field); $account_ids = SugarTestAccountUtilities::getCreatedAccountIds(); $contact_ids = SugarTestContactUtilities::getCreatedContactIds(); $GLOBALS['db']->query('DELETE FROM accounts_contacts WHERE contact_id IN (\'' . implode("', '", $contact_ids) . '\') OR account_id IN (\'' . implode("', '", $account_ids) . '\')'); SugarTestContactUtilities::removeAllCreatedContacts(); SugarTestAccountUtilities::removeAllCreatedAccounts(); SugarTestUserUtilities::removeAllCreatedAnonymousUsers(); unset($GLOBALS['current_user']); unset($GLOBALS['beanFiles']); unset($GLOBALS['beanList']); }
public function testConversionAndDoNothing() { global $sugar_config; // init $lead = SugarTestLeadUtilities::createLead(); $account = SugarTestAccountUtilities::createAccount(); $meeting = SugarTestMeetingUtilities::createMeeting(); SugarTestMeetingUtilities::addMeetingParent($meeting->id, $lead->id); $relation_id = SugarTestMeetingUtilities::addMeetingLeadRelation($meeting->id, $lead->id); $_REQUEST['record'] = $lead->id; // set the request/post parameters before converting the lead $_REQUEST['module'] = 'Leads'; $_REQUEST['action'] = 'ConvertLead'; $_REQUEST['record'] = $lead->id; $_REQUEST['handle'] = 'save'; $_REQUEST['selectedAccount'] = $account->id; $sugar_config['lead_conv_activity_opt'] = 'none'; // call display to trigger conversion $vc = new ViewConvertLead(); $vc->display(); // refresh meeting $meeting_id = $meeting->id; $meeting = new Meeting(); $meeting->retrieve($meeting_id); // refresh lead $lead_id = $lead->id; $lead = new Lead(); $lead->retrieve($lead_id); // retrieve the new contact id from the conversion $contact_id = $lead->contact_id; // 1. Lead's contact_id should not be null $this->assertNotNull($contact_id, 'Lead has null contact id after conversion.'); // 2. Lead status should be 'Converted' $this->assertEquals('Converted', $lead->status, "Lead atatus should be 'Converted'."); // 3. parent_type of the original meeting should be Leads $this->assertEquals('Leads', $meeting->parent_type, 'Meeting parent should be Leads'); // 4. parent_id of the original meeting should be contact id $this->assertEquals($lead_id, $meeting->parent_id, 'Meeting parent id should be lead id.'); // 5. record should NOT be deleted from meetings_leads table $sql = "select id from meetings_leads where meeting_id='{$meeting->id}' and lead_id='{$lead->id}' and deleted=0"; $result = $GLOBALS['db']->query($sql); $row = $GLOBALS['db']->fetchByAssoc($result); $this->assertFalse(empty($row), "Meeting-Lead relationship is removed."); // 6. record should NOT be added to meetings_contacts table $sql = "select meeting_id from meetings_contacts where contact_id='{$contact_id}' and deleted=0"; $result = $GLOBALS['db']->query($sql); $row = $GLOBALS['db']->fetchByAssoc($result); $this->assertFalse($row, "Meeting-Contact relationship should not be added."); // clean up unset($_REQUEST['record']); $GLOBALS['db']->query("delete from meetings where parent_id='{$lead->id}' and parent_type= 'Leads'"); $GLOBALS['db']->query("delete from meetings where parent_id='{$contact_id}' and parent_type= 'Contacts'"); $GLOBALS['db']->query("delete from contacts where id='{$contact_id}'"); $GLOBALS['db']->query("delete from meetings_leads where meeting_id='{$meeting->id}' and lead_id= '{$lead_id}'"); $GLOBALS['db']->query("delete from meetings_contacts where contact_id= '{$contact_id}'"); SugarTestMeetingUtilities::deleteMeetingLeadRelation($relation_id); SugarTestMeetingUtilities::removeMeetingContacts(); SugarTestMeetingUtilities::removeAllCreatedMeetings(); SugarTestAccountUtilities::removeAllCreatedAccounts(); SugarTestLeadUtilities::removeAllCreatedLeads(); }
/** * * @dataProvider handleRequestRelateProvider * @param $rel_link_name */ public function testHandleRequestRelate($rel_link_name, $expected) { $acc1 = SugarTestAccountUtilities::createAccount(); $acc2 = SugarTestAccountUtilities::createAccount(); $macc = new MockAccountSugarBean(); $macc->retrieve($acc2->id); $ret = $macc->handle_request_relate($acc1->id, $rel_link_name); $this->assertSame($expected, $ret); unset($macc); SugarTestAccountUtilities::removeAllCreatedAccounts(); }
public function tearDown() { $this->df->deleteField($this->field); SugarTestAccountUtilities::removeAllCreatedAccounts(); parent::tearDown(); global $soap_version_test_accountId, $soap_version_test_opportunityId, $soap_version_test_contactId; unset($soap_version_test_accountId); unset($soap_version_test_opportunityId); unset($soap_version_test_contactId); SugarTestHelper::tearDown(); }
public function tearDown() { unset($GLOBALS['current_user']); SugarTestAccountUtilities::removeAllCreatedAccounts(); }
/** * Removing field, account, contact */ public function tearDown() { SugarTestContactUtilities::removeAllCreatedContacts(); SugarTestAccountUtilities::removeAllCreatedAccounts(); $this->dynamicField->deleteField($this->field); SugarTestHelper::tearDown(); }
public function tearDown() { $this->markTestIncomplete("This test is not yet complete. Artem is working on it"); $this->deleteRelationship('Accounts'); SugarTestUserUtilities::removeAllCreatedAnonymousUsers(); unset($GLOBALS['current_user']); unset($GLOBALS['beanFiles'], $GLOBALS['beanList']); unset($GLOBALS['app_strings'], $GLOBALS['app_list_strings'], $GLOBALS['mod_strings']); SugarTestUserUtilities::removeAllCreatedAnonymousUsers(); SugarTestAccountUtilities::removeAllCreatedAccounts(); unset($this->parentAccount); }
/** * Test to make sure that when a bean is cloned it removes all loaded relationships so they can be recreated on * the cloned copy if they are called. * * @group 51630 * @return void */ public function testCloneBeanDoesntKeepRelationship() { $account = SugarTestAccountUtilities::createAccount(); $account->load_relationship('contacts'); // lets make sure the relationship is loaded $this->assertTrue(isset($account->contacts)); $clone_account = clone $account; // lets make sure that the relationship is not on the cloned record $this->assertFalse(isset($clone_account->contacts)); SugarTestAccountUtilities::removeAllCreatedAccounts(); }