Commit | Line | Data |
---|---|---|
19b53e5b C |
1 | <?php |
2 | ||
380f3545 TO |
3 | /* |
4 | +--------------------------------------------------------------------+ | |
7d61e75f | 5 | | Copyright CiviCRM LLC. All rights reserved. | |
380f3545 | 6 | | | |
7d61e75f TO |
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 | | |
380f3545 TO |
10 | +--------------------------------------------------------------------+ |
11 | */ | |
12 | ||
13 | /** | |
14 | * | |
15 | * @package CRM | |
ca5cec67 | 16 | * @copyright CiviCRM LLC https://civicrm.org/licensing |
380f3545 TO |
17 | * $Id$ |
18 | * | |
19 | */ | |
20 | ||
21 | ||
19b53e5b C |
22 | namespace api\v4\Action; |
23 | ||
24 | use api\v4\UnitTestCase; | |
25 | use Civi\Api4\Contact; | |
26 | ||
27 | /** | |
28 | * @group headless | |
29 | */ | |
30 | class GetExtraFieldsTest extends UnitTestCase { | |
31 | ||
32 | public function testBAOFieldsWillBeReturned() { | |
33 | $returnedFields = Contact::getFields() | |
34 | ->execute() | |
35 | ->getArrayCopy(); | |
36 | ||
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); | |
41 | ||
42 | $this->assertEmpty($notReturned); | |
43 | } | |
44 | ||
45 | } |