INFRA-132 - Fix misc oddball syntax
[civicrm-core.git] / tests / phpunit / CRM / Batch / Form / EntryTest.php
index 1fab4fb6441f3b2bd568bcd4ebe326709cb56b58..c19d8114510eae1d7f948b8b272a91f264e8b0d8 100644 (file)
@@ -5,7 +5,7 @@
  *
  *  (PHP 5)
  *
- *   @package   CiviCRM
+ * @package   CiviCRM
  *
  *   This file is part of CiviCRM
  *
@@ -30,7 +30,7 @@ require_once 'CiviTest/CiviUnitTestCase.php';
 /**
  *  Test CRM/Member/BAO Membership Log add , delete functions
  *
- *  @package   CiviCRM
+ * @package   CiviCRM
  */
 class CRM_Batch_Form_EntryTest extends CiviUnitTestCase {
 
@@ -69,19 +69,7 @@ class CRM_Batch_Form_EntryTest extends CiviUnitTestCase {
    */
   protected $_contactID4 = NULL;
 
-  /**
-   * Describe test class
-   * @return array
-   */
-  function get_info() {
-    return array(
-      'name' => 'MembershipParserTest',
-      'description' => 'Test import parser function',
-      'group' => 'CiviCRM BAO Tests',
-    );
-  }
-
-  function setUp() {
+  public function setUp() {
     parent::setUp();
 
     $params = array(
@@ -139,7 +127,7 @@ class CRM_Batch_Form_EntryTest extends CiviUnitTestCase {
    * This method is called after a test is executed.
    *
    */
-  function tearDown()
+  public function tearDown()
   {
     $this->quickCleanUpFinancialEntities();
     $this->relationshipTypeDelete($this->_relationshipTypeId);
@@ -155,7 +143,7 @@ class CRM_Batch_Form_EntryTest extends CiviUnitTestCase {
   /**
    *  Test Import
    */
-  function testProcessMembership() {
+  public function testProcessMembership() {
     $form = new CRM_Batch_Form_Entry();
     $params = $this->getMembershipData();
     $this->assertTrue($form->testProcessMembership($params));
@@ -176,8 +164,8 @@ class CRM_Batch_Form_EntryTest extends CiviUnitTestCase {
     $this->assertEquals(date('Y-m-d', strtotime('now')), $result['values'][3]['join_date']);
     $result = $this->callAPISuccess('contribution', 'get', array('return' => 'total_amount'));
     $this->assertEquals(3, $result['count']);
-    foreach($result['values'] as $contribution) {
-      $this-> assertEquals($this->callAPISuccess('line_item', 'getvalue', array(
+    foreach ($result['values'] as $contribution) {
+      $this->assertEquals($this->callAPISuccess('line_item', 'getvalue', array(
         'contribution_id' => $contribution['id'],
         'return' => 'line_total',
 
@@ -188,38 +176,38 @@ class CRM_Batch_Form_EntryTest extends CiviUnitTestCase {
   /**
    *  Test Contribution Import
    */
-  function testProcessContribution() {
+  public function testProcessContribution() {
     $this->offsetDefaultPriceSet();
     $form = new CRM_Batch_Form_Entry();
     $params = $this->getContributionData();
     $this->assertTrue($form->testProcessContribution($params));
     $result = $this->callAPISuccess('contribution', 'get', array('return' => 'total_amount'));
     $this->assertEquals(2, $result['count']);
-    foreach($result['values'] as $contribution) {
-     $this-> assertEquals($this->callAPISuccess('line_item', 'getvalue', array(
+    foreach ($result['values'] as $contribution) {
+      $this->assertEquals($this->callAPISuccess('line_item', 'getvalue', array(
        'contribution_id' => $contribution['id'],
        'return' => 'line_total',
 
-     )), $contribution['total_amount']);
+      )), $contribution['total_amount']);
     }
   }
   /**
-   * data provider for test process membership
+   * Data provider for test process membership
    * @return array
    */
-  function getMembershipData() {
+  public function getMembershipData() {
 
     return array(
       'batch_id' => 4,
       'primary_profiles' => array(1 => NULL, 2 => NULL, 3 => NULL),
-      'primary_contact_id' => Array (
+      'primary_contact_id' => array(
         1 => $this->_contactID,
         2 => $this->_contactID2,
         3 => $this->_contactID3,
         ),
       'field' => array(
         1 => array(
-          'membership_type' => Array (0 => $this->_orgContactID, 1 => $this->_membershipTypeID),
+          'membership_type' => array(0 => $this->_orgContactID, 1 => $this->_membershipTypeID),
           'join_date' => '07/22/2013',
           'membership_start_date' => NULL,
           'membership_end_date' => NULL,
@@ -233,7 +221,7 @@ class CRM_Batch_Form_EntryTest extends CiviUnitTestCase {
           'contribution_status_id' => 1,
         ),
       2 => array(
-        'membership_type' => Array (0 => $this->_orgContactID, 1 => $this->_membershipTypeID),
+        'membership_type' => array(0 => $this->_orgContactID, 1 => $this->_membershipTypeID),
         'join_date' => '07/03/2013',
         'membership_start_date' => '02/03/2013',
         'membership_end_date' => NULL,
@@ -248,7 +236,7 @@ class CRM_Batch_Form_EntryTest extends CiviUnitTestCase {
        ),
         // no join date, coded end date
        3 => array(
-         'membership_type' => Array (0 => $this->_orgContactID, 1 => $this->_membershipTypeID),
+         'membership_type' => array(0 => $this->_orgContactID, 1 => $this->_membershipTypeID),
          'join_date' => NULL,
          'membership_start_date' => NULL,
          'membership_end_date' => '2013-12-01',
@@ -271,11 +259,11 @@ class CRM_Batch_Form_EntryTest extends CiviUnitTestCase {
   /**
    * @return array
    */
-  function getContributionData() {
+  public function getContributionData() {
     return array(
       //'batch_id' => 4,
       'primary_profiles' => array(1 => NULL, 2 => NULL, 3 => NULL),
-      'primary_contact_id' => Array (
+      'primary_contact_id' => array(
         1 => $this->_contactID,
         2 => $this->_contactID2,
         3 => $this->_contactID3,
@@ -305,4 +293,3 @@ class CRM_Batch_Form_EntryTest extends CiviUnitTestCase {
     );
   }
 }
-