Commit | Line | Data |
---|---|---|
057e323f CW |
1 | <?php |
2 | ||
3 | /* | |
4 | +--------------------------------------------------------------------+ | |
5 | | Copyright CiviCRM LLC. All rights reserved. | | |
6 | | | | |
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 | +--------------------------------------------------------------------+ | |
11 | */ | |
12 | ||
13 | /** | |
14 | * | |
15 | * @package CRM | |
16 | * @copyright CiviCRM LLC https://civicrm.org/licensing | |
17 | */ | |
18 | ||
19 | ||
20 | namespace api\v4\Entity; | |
21 | ||
22 | use api\v4\UnitTestCase; | |
23 | use Civi\Api4\GroupContact; | |
24 | ||
25 | /** | |
26 | * @group headless | |
27 | */ | |
28 | class GroupContactTest extends UnitTestCase { | |
29 | ||
30 | public function testCreate() { | |
31 | $contact = $this->createEntity(['type' => 'Individual']); | |
32 | $group = $this->createEntity(['type' => 'Group']); | |
33 | $result = GroupContact::create(FALSE) | |
34 | ->addValue('group_id', $group['id']) | |
35 | ->addValue('contact_id', $contact['id']) | |
36 | ->execute() | |
37 | ->first(); | |
38 | $this->assertEquals('Added', $result['status']); | |
39 | } | |
40 | ||
41 | } |