Fixed indentation.
authorSaurabh Batra <saurabh.batra96@gmail.com>
Mon, 19 Oct 2015 07:38:33 +0000 (13:08 +0530)
committerSaurabh Batra <saurabh.batra96@gmail.com>
Mon, 19 Oct 2015 12:04:25 +0000 (17:34 +0530)
CRM/Financial/Page/AJAX.php
tests/phpunit/CRM/Financial/Page/AjaxBatchSummaryTest.php

index 871da971f439a795224d52ab29f9f5b79d49df57..c03fd36a99baff4cb23205b9b11bdc21b36d16ea 100644 (file)
@@ -518,7 +518,7 @@ class CRM_Financial_Page_AJAX {
   public static function getBatchSummary() {
     $batchID = CRM_Utils_Type::escape($_REQUEST['batchID'], 'String');
     $params = array('id' => $batchID);
-    
+
     $batchSummary = makeBatchSummary($batchID, $params);
 
     CRM_Utils_JSON::output($batchSummary);
@@ -533,9 +533,9 @@ class CRM_Financial_Page_AJAX {
    * @return array
    */
   public static function makeBatchSummary($batchID, $params) {
-       $batchInfo = CRM_Batch_BAO_Batch::retrieve($params, $value);
+    $batchInfo = CRM_Batch_BAO_Batch::retrieve($params, $value);
     $batchTotals = CRM_Batch_BAO_Batch::batchTotals(array($batchID));
-       $batchSummary = array(
+    $batchSummary = array(
       'created_by' => CRM_Contact_BAO_Contact::displayName($batchInfo->created_id),
       'status' => CRM_Core_PseudoConstant::getLabel('CRM_Batch_BAO_Batch', 'status_id', $batchInfo->status_id),
       'description' => $batchInfo->description,
@@ -549,4 +549,5 @@ class CRM_Financial_Page_AJAX {
 
     return $batchSummary;
   }
+
 }
index 6ec7b1e139bbf1e7b7d57a5ca075e6e967dd84c3..71442cfe79da47802676107b78640aff170063cc 100644 (file)
@@ -30,20 +30,21 @@ require_once 'CiviTest/CiviUnitTestCase.php';
  * Test for CRM_Financial_Page_Ajax class.
  */
 class CRM_Financial_Page_AjaxBatchSummaryTest extends CiviUnitTestCase {
-       /**
-        * Test the makeBatchSummary function.
-        *
-        * We want to ensure changing the meethod of obtaining status and payment_instrument
-        * does not cause any regression.
-        */
-    public function testMakeBatchSummary() {
-       $batch = $this->callAPISuccess('Batch', 'create', array('title' => 'test', 'status_id' => 'Open', 'payment_instrument_id' => 'Cash'));
+  /**
+   * Test the makeBatchSummary function.
+   *
+   * We want to ensure changing the method of obtaining status and payment_instrument
+   * does not cause any regression.
+   */
+  public function testMakeBatchSummary() {
+    $batch = $this->callAPISuccess('Batch', 'create', array('title' => 'test', 'status_id' => 'Open', 'payment_instrument_id' => 'Cash'));
 
-       $batchID = $batch['id'];
-       $params = array('id' => $batchID);
-       $makeBatchSummary = CRM_Financial_Page_AJAX::makeBatchSummary($batchID,$params);
+    $batchID = $batch['id'];
+    $params = array('id' => $batchID);
+    $makeBatchSummary = CRM_Financial_Page_AJAX::makeBatchSummary($batchID, $params);
+
+    $this->assertEquals('Open', $makeBatchSummary['status']);
+    $this->assertEquals('Cash', $makeBatchSummary['payment_instrument']);
+  }
 
-       $this->assertEquals('Open', $makeBatchSummary['status']);
-       $this->assertEquals('Cash', $makeBatchSummary['payment_instrument']);
-    }
 }