Merge pull request #17122 from colemanw/buildOptions
[civicrm-core.git] / tests / phpunit / api / v4 / Action / EventTest.php
CommitLineData
57b75c5c 1<?php
2
3/*
4 +--------------------------------------------------------------------+
7d61e75f 5 | Copyright CiviCRM LLC. All rights reserved. |
57b75c5c 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 |
57b75c5c 10 +--------------------------------------------------------------------+
11 */
12
13/**
14 *
15 * @package CRM
ca5cec67 16 * @copyright CiviCRM LLC https://civicrm.org/licensing
57b75c5c 17 */
18
19use Civi\Api4\Event;
20
21/**
22 * @group headless
23 */
24class EventTest extends \api\v4\UnitTestCase {
25
26 /**
27 * Test that the event api filters out templates by default.
28 *
29 * @throws \Civi\API\Exception\UnauthorizedException
30 */
31 public function testTemplateFilterByDefault() {
32 Event::create()->setValues(['template_title' => 'Big Event', 'is_template' => 1, 'start_date' => 'now', 'event_type_id' => 'Meeting'])->execute();
33 Event::create()->setValues(['title' => 'Bigger Event', 'start_date' => 'now', 'event_type_id' => 'Meeting'])->execute();
34 $this->assertEquals(1, Event::get()->selectRowCount()->execute()->count());
35 }
36
37}