4 +--------------------------------------------------------------------+
5 | Copyright CiviCRM LLC. All rights reserved. |
7 | This work is published under the GNU AGPLv3 license with some |
8 | permitted exceptions and without any warranty. For full license |
9 | and copyright information, see https://civicrm.org/licensing |
10 +--------------------------------------------------------------------+
16 * @copyright CiviCRM LLC https://civicrm.org/licensing
22 namespace api\v
4\Action
;
24 use api\v
4\UnitTestCase
;
25 use Civi\Api4\Contact
;
30 class GetExtraFieldsTest
extends UnitTestCase
{
32 public function testBAOFieldsWillBeReturned() {
33 $returnedFields = Contact
::getFields()
37 $baseFields = \CRM_Contact_BAO_Contact
::fields();
38 $baseFieldNames = array_column($baseFields, 'name');
39 $returnedFieldNames = array_column($returnedFields, 'name');
40 $notReturned = array_diff($baseFieldNames, $returnedFieldNames);
42 $this->assertEmpty($notReturned);