Ejegg has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/386675 )

Change subject: WIP MergeTest detects double is_primary
......................................................................

WIP MergeTest detects double is_primary

This should fail on the current merge hook, fix to come

Bug: T178819
Change-Id: I12799a44e4e417fc7d90be6382e7915c5d292726
---
M sites/all/modules/wmf_civicrm/tests/phpunit/MergeTest.php
1 file changed, 5 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/wikimedia/fundraising/crm 
refs/changes/75/386675/1

diff --git a/sites/all/modules/wmf_civicrm/tests/phpunit/MergeTest.php 
b/sites/all/modules/wmf_civicrm/tests/phpunit/MergeTest.php
index 44fe14a..63a0fe3 100644
--- a/sites/all/modules/wmf_civicrm/tests/phpunit/MergeTest.php
+++ b/sites/all/modules/wmf_civicrm/tests/phpunit/MergeTest.php
@@ -293,8 +293,13 @@
     }
     $this->assertEquals(count($dataSet['expected_hook']), $addresses['count']);
     $locationTypes = $this->callAPISuccess($dataSet['entity'], 'getoptions', 
array('field' => 'location_type_id'));
+    $alreadyHasPrimary = false;
     foreach ($dataSet['expected_hook'] as $index => $expectedAddress) {
       foreach ($addresses['values'] as $index => $address) {
+        if ($address['is_primary']) {
+          $this->assertFalse($alreadyHasPrimary);
+          $alreadyHasPrimary = true;
+        }
         // compared to the previous test the addresses are in a different 
order (for some datasets.
         // so, first find the matching address and then check it fully matches.
         // by unsetting afterwards we should find them all gone by the end.

-- 
To view, visit https://gerrit.wikimedia.org/r/386675
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I12799a44e4e417fc7d90be6382e7915c5d292726
Gerrit-PatchSet: 1
Gerrit-Project: wikimedia/fundraising/crm
Gerrit-Branch: master
Gerrit-Owner: Ejegg <ej...@ejegg.com>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to