2 require_once 'include/vCard.php';
4 class vCardBug40629Test extends Sugar_PHPUnit_Framework_TestCase
8 public function setUp()
10 $GLOBALS['current_user'] = SugarTestUserUtilities::createAnonymousUser();
11 $this->account = SugarTestAccountUtilities::createAccount();
12 $this->account->name = "SDizzle Inc";
13 $this->account->save();
16 public function tearDown()
18 unset($GLOBALS['current_user']);
19 SugarTestAccountUtilities::removeAllCreatedAccounts();
25 public function testImportedVcardAccountLink()
27 $filename = dirname(__FILE__)."/SimpleVCard.vcf";
30 $contact_id = $vcard->importVCard($filename,'Contacts');
31 $contact_record = new Contact();
32 $contact_record->retrieve($contact_id);
34 $this->assertFalse(empty($contact_record->account_id), "Contact should have an account record associated");
35 $GLOBALS['db']->query("delete from contacts where id = '{$contact_id}'");
38 $lead_id = $vcard->importVCard($filename,'Leads');
39 $lead_record = new Lead();
40 $lead_record->retrieve($lead_id);
42 $this->assertTrue(empty($lead_record->account_id), "Lead should not have an account record associated");
43 $GLOBALS['db']->query("delete from leads where id = '{$lead_id}'");