Merge pull request #5536 from totten/4.5-httpclient
[civicrm-core.git] / tests / phpunit / api / v3 / ActivityTest.php
index 078cb9884ce0e10c0b3a31ee0db7f5aa9f116785..0236aed7c812ca3ad50e6422306b946541754cd7 100644 (file)
@@ -331,7 +331,7 @@ class api_v3_ActivityTest extends CiviUnitTestCase {
    */
   public function testActivityReturnTargetAssignee() {
 
-    $description = "Example demonstrates setting & retrieving the target & source";
+    $description = "Demonstrates setting & retrieving activity target & source.";
     $subfile = "GetTargetandAssignee";
     $params = array(
       'source_contact_id' => $this->_contactID,
@@ -394,7 +394,7 @@ class api_v3_ActivityTest extends CiviUnitTestCase {
 
     $this->callAPISuccess('contact', 'create', array('id' => $this->_contactID, 'sort_name' => 'Contact, Test'));
     $subfile = 'ContactRefCustomField';
-    $description = "demonstrates create with Contact Reference Custom Field";
+    $description = "Demonstrates create with Contact Reference Custom Field.";
     $ids = $this->entityCustomGroupWithSingleFieldCreate(__FUNCTION__, __FILE__);
     $params = array(
       'custom_group_id' => $ids['custom_group_id'],
@@ -411,11 +411,11 @@ class api_v3_ActivityTest extends CiviUnitTestCase {
     $params = $this->_params;
     $params['custom_' . $customField['id']] = "$this->_contactID";
 
-    $result = $this->callAPIAndDocument($this->_entity, 'create', $params, __FUNCTION__, __FILE__, $description, $subfile, 'Create');
+    $result = $this->callAPIAndDocument($this->_entity, 'create', $params, __FUNCTION__, __FILE__, $description, $subfile);
     $result = $this->callAPIAndDocument($this->_entity, 'get', array(
       'return.custom_' . $customField['id'] => 1,
       'id' => $result['id'],
-    ), __FUNCTION__, __FILE__, 'Get with Contact Ref Custom Field', 'ContactRefCustomFieldGet', 'get');
+    ), __FUNCTION__, __FILE__, 'Get with Contact Ref Custom Field', 'ContactRefCustomFieldGet');
 
     $this->assertEquals('Anderson, Anthony', $result['values'][$result['id']]['custom_' . $customField['id']]);
     $this->assertEquals($this->_contactID, $result['values'][$result['id']]['custom_' . $customField['id'] . "_id"], ' in line ' . __LINE__);
@@ -500,9 +500,8 @@ class api_v3_ActivityTest extends CiviUnitTestCase {
    * Test civicrm_activity_get() with a good activity ID
    */
   public function testActivityGetGoodID1() {
-    // Insert rows in civicrm_activity creating activities 4 and
-    // 13
-    $description = "Function demonstrates getting asignee_contact_id & using it to get the contact";
+    // Insert rows in civicrm_activity creating activities 4 and 13
+    $description = "Demonstrates getting assignee_contact_id & using it to get the contact.";
     $subfile = 'ReturnAssigneeContact';
     $activity = $this->callAPISuccess('activity', 'create', $this->_params);
 
@@ -665,7 +664,7 @@ class api_v3_ActivityTest extends CiviUnitTestCase {
     $result = $this->callAPISuccess('Activity', 'Get', array(
       'version' => 3,
     ));
-    $description = "demonstrates _low filter (at time of writing doesn't work if contact_id is set";
+    $description = "Demonstrates _low filter (at time of writing doesn't work if contact_id is set.";
     $subfile = "DateTimeLow";
     $this->assertEquals(2, $result['count']);
     $params = array(
@@ -675,7 +674,7 @@ class api_v3_ActivityTest extends CiviUnitTestCase {
     );
     $result = $this->callAPIAndDocument('Activity', 'Get', $params, __FUNCTION__, __FILE__, $description, $subfile);
     $this->assertEquals(1, $result['count']);
-    $description = "demonstrates _high filter (at time of writing doesn't work if contact_id is set";
+    $description = "Demonstrates _high filter (at time of writing doesn't work if contact_id is set.";
     $subfile = "DateTimeHigh";
     $this->assertEquals('2012-02-16 00:00:00', $result['values'][0]['activity_date_time']);
     $params = array(
@@ -795,8 +794,7 @@ class api_v3_ActivityTest extends CiviUnitTestCase {
       'version' => $this->_apiversion,
     );
 
-    $result = $this->callAPISuccess('activity', 'delete', $params);
-    $this->documentMe($params, $result, __FUNCTION__, __FILE__);
+    $this->callAPIAndDocument('activity', 'delete', $params, __FUNCTION__, __FILE__);
   }
 
   /**
@@ -1177,7 +1175,7 @@ class api_v3_ActivityTest extends CiviUnitTestCase {
    */
   public function testGetFields() {
     $params = array('action' => 'create');
-    $result = $this->callAPIAndDocument('activity', 'getfields', $params, __FUNCTION__, __FILE__, NULL, NULL, 'getfields');
+    $result = $this->callAPIAndDocument('activity', 'getfields', $params, __FUNCTION__, __FILE__, NULL, NULL);
     $this->assertTrue(is_array($result['values']), 'get fields doesn\'t return values array');
     foreach ($result['values'] as $key => $value) {
       $this->assertTrue(is_array($value), $key . " is not an array");