Merge pull request #23309 from civicrm/5.49
[civicrm-core.git] / tests / phpunit / api / v4 / Entity / GroupContactTest.php
CommitLineData
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
20namespace api\v4\Entity;
21
22use api\v4\UnitTestCase;
23use Civi\Api4\GroupContact;
24
25/**
26 * @group headless
27 */
28class 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}