-- CRM-13037 handled for GroupBy clause and for selecting the correct report object
authorRavish Nair <ravish.nair@webaccess.co.in>
Thu, 8 Aug 2013 08:27:15 +0000 (13:57 +0530)
committerRavish Nair <ravish.nair@webaccess.co.in>
Thu, 8 Aug 2013 08:27:15 +0000 (13:57 +0530)
----------------------------------------
* CRM-13037: Navigating among tabs produces wrong popups
  http://issues.civicrm.org/jira/browse/CRM-13037

tests/phpunit/CiviTest/CiviReportTestCase.php

index c1f532899151ee916c436be7488ebd9e9809578c..e3f08cb7b077ca5b4dcb627fd6955a781b956ed9 100644 (file)
@@ -45,7 +45,9 @@ class CiviReportTestCase extends CiviUnitTestCase {
     $config = CRM_Core_Config::singleton();
     $config->keyDisable = TRUE;
     $controller = new CRM_Core_Controller_Simple($reportClass, ts('some title'));
-    $reportObj =& $controller->_pages['Detail']; //FIXME - Detail is going to change
+    $tmpReportVal = explode('_', $reportClass);
+    $reportName = array_pop($tmpReportVal);
+    $reportObj =& $controller->_pages[$reportName];
 
     $tmpGlobals = array();
     $tmpGlobals['_REQUEST']['force'] = 1;
@@ -61,6 +63,11 @@ class CiviReportTestCase extends CiviUnitTestCase {
         $tmpGlobals['_GET'][$key] = $val;
       }
     }
+    if (!empty($inputParams['group_bys'])) {
+      $groupByFields = implode(' ', $inputParams['group_bys']);
+      $tmpGlobals['_GET']['gby'] = $groupByFields;
+    }
+
     CRM_Utils_GlobalStack::singleton()->push($tmpGlobals);
 
     try {