4 +--------------------------------------------------------------------+
5 | Copyright CiviCRM LLC. All rights reserved. |
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 +--------------------------------------------------------------------+
16 * @copyright CiviCRM LLC https://civicrm.org/licensing
24 class EventTest
extends \api\v
4\UnitTestCase
{
27 * Test that the event api filters out templates by default.
29 * @throws \Civi\API\Exception\UnauthorizedException
31 public function testTemplateFilterByDefault() {
32 $t = Event
::create()->setValues(['template_title' => 'Big Event', 'is_template' => 1, 'start_date' => 'now', 'event_type_id:name' => 'Meeting'])->execute()->first();
33 $e = Event
::create()->setValues(['title' => 'Bigger Event', 'start_date' => 'now', 'event_type_id:name' => 'Meeting'])->execute()->first();
34 $result = (array) Event
::get()->execute()->column('id');
35 $this->assertContains($e['id'], $result);
36 $this->assertNotContains($t['id'], $result);