more comment fixes
authorEileen McNaughton <eileen@fuzion.co.nz>
Tue, 3 Feb 2015 00:59:39 +0000 (13:59 +1300)
committerEileen McNaughton <eileen@fuzion.co.nz>
Tue, 3 Feb 2015 00:59:39 +0000 (13:59 +1300)
tests/phpunit/api/v3/ActionScheduleTest.php
tests/phpunit/api/v3/LocBlockTest.php

index e403dd2debc05f7ebbea6c02bca41223d86df2b4..7fca8f8abb4b9b361fab0c4eb8e6d472cfaf8ea2 100644 (file)
@@ -1,6 +1,7 @@
 <?php
 /**
- *  File for the TestActionSchedule class
+ * @file
+ * File for the TestActionSchedule class
  *
  *  (PHP 5)
  *
@@ -37,24 +38,21 @@ class api_v3_ActionScheduleTest extends CiviUnitTestCase {
   protected $_entity = 'action_schedule';
   protected $_apiversion = 3;
 
-
   /**
-   *  Test setup for every test
-   *
-   *  Connect to the database, truncate the tables that will be used
-   *  and redirect stdin to a temporary file
+   * Test setup for every test.
    */
   public function setUp() {
-    //  Connect to the database
     parent::setUp();
     $this->useTransaction(TRUE);
   }
 
+  /**
+   * Test simple create action schedule.
+   */
   public function testSimpleActionScheduleCreate() {
     $oldCount = CRM_Core_DAO::singleValueQuery('select count(*) from civicrm_action_schedule');
     $activityContacts = CRM_Core_OptionGroup::values('activity_contacts', FALSE, FALSE, FALSE, NULL, 'name');
     $assigneeID = CRM_Utils_Array::key('Activity Assignees', $activityContacts);
-    $targetID = CRM_Utils_Array::key('Activity Targets', $activityContacts);
     $scheduledStatus = CRM_Core_OptionGroup::getValue('activity_status', 'Scheduled', 'name');
     $mappingId = CRM_Core_DAO::getFieldValue('CRM_Core_DAO_ActionMapping', 'activity_type', 'id', 'entity_value');
     $activityTypeId = CRM_Core_OptionGroup::getValue('activity_type', "Meeting", 'name');
@@ -71,14 +69,14 @@ class api_v3_ActionScheduleTest extends CiviUnitTestCase {
       'mapping_id' => $mappingId,
     );
     $actionSchedule = $this->callAPISuccess('action_schedule', 'create', $params);
-    $this->assertTrue(is_numeric($actionSchedule['id']), "In line " . __LINE__);
-    $this->assertTrue($actionSchedule['id'] > 0, "In line " . __LINE__);
+    $this->assertTrue(is_numeric($actionSchedule['id']));
+    $this->assertTrue($actionSchedule['id'] > 0);
     $newCount = CRM_Core_DAO::singleValueQuery('select count(*) from civicrm_action_schedule');
     $this->assertEquals($oldCount + 1, $newCount);
   }
 
   /**
-   * Check if required fields are not passed
+   * Check if required fields are not passed.
    */
   public function testActionScheduleCreateWithoutRequired() {
     $params = array(
@@ -89,7 +87,7 @@ class api_v3_ActionScheduleTest extends CiviUnitTestCase {
   }
 
   /**
-   *
+   * Test create with scheduled dates.
    */
   public function testActionScheduleWithScheduledDatesCreate() {
     $oldCount = CRM_Core_DAO::singleValueQuery('select count(*) from civicrm_action_schedule');
@@ -123,8 +121,8 @@ class api_v3_ActionScheduleTest extends CiviUnitTestCase {
       'subject' => 'Test subject',
     );
     $actionSchedule = $this->callAPISuccess('action_schedule', 'create', $params);
-    $this->assertTrue(is_numeric($actionSchedule['id']), "In line " . __LINE__);
-    $this->assertTrue($actionSchedule['id'] > 0, "In line " . __LINE__);
+    $this->assertTrue(is_numeric($actionSchedule['id']));
+    $this->assertTrue($actionSchedule['id'] > 0);
     $this->assertEquals($actionSchedule['values'][$actionSchedule['id']]['start_action_offset'][0], $params['start_action_offset']);
     $newCount = CRM_Core_DAO::singleValueQuery('select count(*) from civicrm_action_schedule');
     $this->assertEquals($oldCount + 1, $newCount);
index 3d83a910a17bdffa744ee0bb85ede467c2955c71..baf8446be59233cc3ba1058344212a43ebd0f030 100644 (file)
@@ -34,6 +34,9 @@ class api_v3_LocBlockTest extends CiviUnitTestCase {
   protected $_apiversion = 3;
   protected $_entity = 'loc_block';
 
+  /**
+   * Set up.
+   */
   public function setUp() {
     parent::setUp();
     $this->useTransaction(TRUE);
@@ -113,7 +116,7 @@ class api_v3_LocBlockTest extends CiviUnitTestCase {
     $this->assertEquals($params['phone_2']['phone'], $result['phone_2']['phone']);
     $this->assertEquals($params['address']['street_address'], $result['address']['street_address']);
 
-     $this->callAPISuccess($this->_entity, 'delete', array('id' => $id));
+    $this->callAPISuccess($this->_entity, 'delete', array('id' => $id));
   }
 
 }