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 | */ |
18 | ||
19 | ||
19b53e5b C |
20 | namespace api\v4\Action; |
21 | ||
22 | use Civi\Api4\Event; | |
23 | use api\v4\UnitTestCase; | |
24 | ||
25 | /** | |
26 | * @group headless | |
27 | */ | |
28 | class RequiredFieldTest extends UnitTestCase { | |
29 | ||
30 | public function testRequired() { | |
31 | $msg = ''; | |
32 | try { | |
33 | Event::create()->execute(); | |
34 | } | |
35 | catch (\API_Exception $e) { | |
36 | $msg = $e->getMessage(); | |
37 | } | |
38 | $this->assertEquals('Mandatory values missing from Api4 Event::create: title, event_type_id, start_date', $msg); | |
39 | } | |
40 | ||
41 | } |