From 226952faa8701af1e65e01088398f0627cef093c Mon Sep 17 00:00:00 2001 From: Seamus Lee Date: Wed, 9 Oct 2019 20:24:42 +1100 Subject: [PATCH] Fix unit test for APIv4 format --- tests/phpunit/api/v3/ContactTest.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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']; -- 2.25.1