contact = SugarTestContactUtilities::createContact(); } public function tearDown() { SugarTestContactUtilities::removeAllCreatedContacts(); unset($this->contact); unset($GLOBALS['beanFiles'], $GLOBALS['beanList']); SugarTestUserUtilities::removeAllCreatedAnonymousUsers(); unset($GLOBALS['current_user']); } /** * @group 51264 */ public function testIsADuplicateRecordWithID() { $idc = new ImportDuplicateCheck($this->contact); $result = $idc->isADuplicateRecord(array('special_idx_email1::email1')); $this->assertFalse($result); } /** * @group 51264 */ public function testIsADuplicateRecordWithInvalidID() { $contact = new Contact(); $contact->id = '0000000000000000'; $contact->email1 = $this->contact->email1; $idc = new ImportDuplicateCheck($contact); $result = $idc->isADuplicateRecord(array('special_idx_email1::email1')); $this->assertTrue($result); } /** * @group 51264 */ public function testIsADuplicateRecordWithInvalidID2() { $contact = new Contact(); $contact->id = '0000000000000000'; $contact->email1 = 'Bug51264Test@Bug51264Test.com'; $idc = new ImportDuplicateCheck($contact); $result = $idc->isADuplicateRecord(array('special_idx_email1::email1')); $this->assertFalse($result); } /** * @group 51264 */ public function testIsADuplicateRecord() { $contact = new Contact(); $contact->email1 = $this->contact->email1; $idc = new ImportDuplicateCheck($contact); $result = $idc->isADuplicateRecord(array('special_idx_email1::email1')); $this->assertTrue($result); } }