'email',
'total_amount',
),
+ 'filters' => array(
+ 'total_amount_op' => 'gte',
+ 'total_amount_value' => 50,
+ ),
// FIXME: add filters
),
'fixtures/dataset.sql',
$expectedOutputCsvArray = $this->getArrayFromCsv(dirname(__FILE__) . "/{$expectedOutputCsvFile}");
$this->assertEquals(count($reportCsvArray[0]), count($expectedOutputCsvArray[0]), 'In line ' . __LINE__);
- $this->compareCsvFiles($reportCsvFile, dirname(__FILE__) . "/{$expectedOutputCsvFile}");
- // FIXME: add more asserts
+ foreach($reportCsvArray as $intKey => $strVal) {
+ $this->assertNotNull($expectedOutputCsvArray[$intKey], 'In line ' . __LINE__);
+ $this->assertEquals($expectedOutputCsvArray[$intKey], $strVal);
+ }
}
}
"Donor Name","First Name","Donor Email","Amount"\r
-" Empowerment Association", , ,"$ 50.00"\r
-"Bachman, Lincoln","Lincoln", ,"$ 175.00"\r
-"Blackwell, Sanford","Sanford","st.blackwell3@testmail.co.pl","$ 250.00"\r
-"Dimitrov, Iris","Iris","irisdimitrov@infomail.co.pl","$ 25.00"\r
-"Dimitrov, Kenny","Kenny", ,"$ 50.00"\r
-"Grant, Megan","Megan","grantm@fishmail.net","$ 500.00"\r
-"merriechowski95@notmail.info", ,"merrie@testmail.co.nz","$ 125.00"\r
-"Müller, Billy","Billy","mller.billy30@example.org","$ 50.00"\r
-"Reynolds, Brent","Brent", ,"$ 10.00"\r
-"Smith, Errol","Errol","errols@sample.com","$ 500.00"\r
+" Empowerment Association", , ,"USD 50.00"\r
+"Bachman, Lincoln","Lincoln", ,"USD 175.00"\r
+"Blackwell, Sanford","Sanford","st.blackwell3@testmail.co.pl","USD 250.00"\r
+"Dimitrov, Kenny","Kenny", ,"USD 50.00"\r
+"Grant, Megan","Megan","grantm@fishmail.net","USD 500.00"\r
+"merriechowski95@notmail.info", ,"merrie@testmail.co.nz","USD 125.00"\r
+"Müller, Billy","Billy","mller.billy30@example.org","USD 50.00"\r
+"Smith, Errol","Errol","errols@sample.com","USD 500.00"\r
$_GET['fld'] = $fields;
$_GET['ufld'] = 1;
}
-
+ if (!empty($inputParams['filters'])) {
+ foreach ($inputParams['filters'] as $key => $val) {
+ $_GET[$key] = $val;
+ }
+ }
$reportObj->storeResultSet();
$reportObj->buildForm();
$rows = $reportObj->getResultSet();
}
return $arrFile;
}
-
- function compareCsvFiles($csvFile1, $csvFile2) {
- $arrFile1 = $this->getArrayFromCsv($csvFile1);
- $arrFile2 = $this->getArrayFromCsv($csvFile2);
-
- $intRow = 0;
- foreach($arrFile1 as $intKey => $strVal) {
- if (count($strVal) != count($arrFile2[$intKey])) {
- //FIXME : exit("Column count doesn't match\n");
- }
- if (!isset($arrFile2[$intKey]) || ($arrFile2[$intKey] != $strVal)) {
- //FIXME: exit("Column $intKey, row $intRow of $strFile1 doesn't match\n");
- }
- $intRow++;
- }
- // FIXME: print "All rows match fine.\n";
- }
}