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