/*
+--------------------------------------------------------------------+
- | CiviCRM version 4.3 |
+ | CiviCRM version 4.5 |
+--------------------------------------------------------------------+
- | Copyright CiviCRM LLC (c) 2004-2013 |
+ | Copyright CiviCRM LLC (c) 2004-2014 |
+--------------------------------------------------------------------+
| This file is a part of CiviCRM. |
| |
protected $_params;
protected $_apiversion;
protected $_entity;
- public $_eNoticeCompliant = TRUE;
+
function get_info() {
return array(
'name' => 'Event Create',
$description = "demonstrates use of is.Current option";
$subfile = "IsCurrentOption";
$result = $this->callAPIAndDocument('Event', 'Get', $params, __FUNCTION__, __FILE__, $description, $subfile);
- $allEvents = $this->callAPISuccess('Event', 'Get', array('version' => 3));
- $this->callAPISuccess('Event', 'Delete', array('version' => 3, 'id' => $currentEvent['id']));
+ $allEvents = $this->callAPISuccess('Event', 'Get', array());
+ $this->callAPISuccess('Event', 'Delete', array('id' => $currentEvent['id']));
$this->assertEquals(1, $result['count'], 'confirm only one event found in line ' . __LINE__);
$this->assertEquals(3, $allEvents['count'], 'confirm three events exist (ie. two not found) ' . __LINE__);
$this->assertEquals($currentEvent['id'], $result['id'], '');
* Trying to delete an event with participants should return error
*/
function testDeleteWithExistingParticipant() {
- $contactID = $this->individualCreate(NULL);
+ $contactID = $this->individualCreate();
$participantID = $this->participantCreate(
array(
'contactID' => $contactID,
$config = &CRM_Core_Config::singleton();
$config->userPermissionClass->permissions = array('access CiviCRM');
$result = $this->callAPIFailure('event', 'create', $params);
- $this->assertEquals('API permission check failed for event/create call; missing permission: access CiviEvent.', $result['error_message'], 'lacking permissions should not be enough to create an event');
+ $this->assertEquals('API permission check failed for event/create call; insufficient permission: require access CiviCRM and access CiviEvent and edit all events', $result['error_message'], 'lacking permissions should not be enough to create an event');
$config->userPermissionClass->permissions = array('access CiviEvent', 'edit all events', 'access CiviCRM');
$result = $this->callAPISuccess('event', 'create', $params);