Merge pull request #20082 from mattwire/paypalwarning
[civicrm-core.git] / tests / phpunit / api / v4 / Entity / CaseTest.php
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 Civi\Api4\CiviCase;
23 use api\v4\UnitTestCase;
24
25 /**
26 * @group headless
27 */
28 class CaseTest extends UnitTestCase {
29
30 public function setUp() {
31 parent::setUp();
32 \CRM_Core_BAO_ConfigSetting::enableComponent('CiviCase');
33 $this->loadDataSet('CaseType');
34 }
35
36 public function testCreateUsingLoggedInUser() {
37 $this->createLoggedInUser();
38
39 $contactID = $this->createEntity(['type' => 'Individual'])['id'];
40
41 $result = CiviCase::create(FALSE)
42 ->addValue('case_type_id', $this->getReference('test_case_type_1')['id'])
43 ->addValue('creator_id', 'user_contact_id')
44 ->addValue('status_id', 1)
45 ->addValue('contact_id', $contactID)
46 ->execute()
47 ->first();
48
49 }
50
51 }