From: Seamus Lee Date: Wed, 9 Oct 2019 09:24:42 +0000 (+1100) Subject: Fix unit test for APIv4 format X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=226952faa8701af1e65e01088398f0627cef093c;p=civicrm-core.git Fix unit test for APIv4 format --- diff --git a/tests/phpunit/api/v3/ContactTest.php b/tests/phpunit/api/v3/ContactTest.php index dfcf158e32..b48a3bb32e 100644 --- a/tests/phpunit/api/v3/ContactTest.php +++ b/tests/phpunit/api/v3/ContactTest.php @@ -638,7 +638,8 @@ class api_v3_ContactTest extends CiviUnitTestCase { 'contact_id' => $contactId, 'return' => 'contact_id.api_key', ]); - $this->assertEquals('abcd1234', $joinResult['contact_id.api_key']); + $field = $this->_apiversion == 4 ? 'contact.api_key' : 'contact_id.api_key'; + $this->assertEquals('abcd1234', $joinResult[$field]); // Restricted return -- because we don't have permission $config->userPermissionClass->permissions = ['access CiviCRM', 'view all contacts', 'edit all contacts'];