Merge pull request #2763 from colemanw/master
[civicrm-core.git] / tests / phpunit / api / v3 / EventTest.php
index c97a56e82b639fe60061197e773a391fc4d819c2..e110df881b1b7f857954a75ba926949de0cb9f87 100644 (file)
@@ -2,9 +2,9 @@
 
 /*
  +--------------------------------------------------------------------+
- | 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.                                    |
  |                                                                    |
@@ -32,7 +32,7 @@ class api_v3_EventTest extends CiviUnitTestCase {
   protected $_params;
   protected $_apiversion;
   protected $_entity;
-  public $_eNoticeCompliant = TRUE;
+
   function get_info() {
     return array(
       'name' => 'Event Create',
@@ -196,8 +196,8 @@ class api_v3_EventTest extends CiviUnitTestCase {
     $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'], '');
@@ -384,7 +384,7 @@ class api_v3_EventTest extends CiviUnitTestCase {
      * 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,
@@ -475,7 +475,7 @@ class api_v3_EventTest extends CiviUnitTestCase {
     $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);