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