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=19aa291157c07dbcf925c8b009bffa57a9590e1a;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 94ee4e49b8..ce980618ab 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'];