Since we should always see the lower id in dstID now and that should always map to entity1
the tests need updating
list($this->_aclFrom, $this->_aclWhere) = CRM_Contact_BAO_Contact_Permission::cacheClause(array('c1', 'c2'));
$this->_aclWhere = $this->_aclWhere ? "AND {$this->_aclWhere}" : '';
}
- $query = "SELECT dedupe.id1, dedupe.id2, dedupe.weight
+ $query = "SELECT IF(dedupe.id1 < dedupe.id2, dedupe.id1, dedupe.id2) as id1,
+ IF(dedupe.id1 < dedupe.id2, dedupe.id2, dedupe.id1) as id2, dedupe.weight
FROM dedupe JOIN civicrm_contact c1 ON dedupe.id1 = c1.id
JOIN civicrm_contact c2 ON dedupe.id2 = c2.id {$this->_aclFrom}
LEFT JOIN civicrm_dedupe_exception exc ON dedupe.id1 = exc.contact_id1 AND dedupe.id2 = exc.contact_id2
$dao->id = 1;
CRM_Core_BAO_PrevNextCache::flipPair(array(1), 0);
$dao->find(TRUE);
- $this->assertEquals(2, $dao->entity_id1);
- $this->assertEquals(1, $dao->entity_id2);
+ $this->assertEquals(1, $dao->entity_id1);
+ $this->assertEquals(2, $dao->entity_id2);
$this->assertEquals(serialize(array(
'srcName' => 'Mr. Maurice Mouse II',
'dstID' => 1,
$this->assertEquals(array(
0 => array(
- 'srcID' => $this->contacts[0]['id'],
+ 'srcID' => $this->contacts[1]['id'],
'srcName' => 'Mr. Mickey Mouse II',
- 'dstID' => $this->contacts[1]['id'],
+ 'dstID' => $this->contacts[0]['id'],
'dstName' => 'Mr. Mickey Mouse II',
'weight' => 20,
'canMerge' => TRUE,
),
1 => array(
- 'srcID' => $this->contacts[2]['id'],
+ 'srcID' => $this->contacts[3]['id'],
'srcName' => 'Mr. Minnie Mouse II',
- 'dstID' => $this->contacts[3]['id'],
+ 'dstID' => $this->contacts[2]['id'],
'dstName' => 'Mr. Minnie Mouse II',
'weight' => 20,
'canMerge' => TRUE,