$fieldName = "LOWER(contact_a.{$fieldName})";
}
else {
- if ($op != 'IN' && !is_numeric($value)) {
+ if ($op != 'IN' && !is_numeric($value) && !is_array($value)) {
$fieldName = "LOWER({$field['where']})";
}
else {
// 2);
}
+ /**
+ * Test retrieval by total_amount works.
+ *
+ * @throws Exception
+ */
+ public function testGetContributionByTotalAmount() {
+ $this->callAPISuccess('Contribution', 'create', array_merge($this->_params, array('total_amount' => '5')));
+ $this->callAPISuccess('Contribution', 'create', array_merge($this->_params, array('total_amount' => '10')));
+ $this->callAPISuccessGetCount('Contribution', array('total_amount' => 10), 1);
+ $this->callAPISuccessGetCount('Contribution', array('total_amount' => array('>' => 6)), 1);
+ $this->callAPISuccessGetCount('Contribution', array('total_amount' => array('>' => 0)), 2);
+ $this->callAPISuccessGetCount('Contribution', array('total_amount' => array('>' => -5)), 2);
+ $this->callAPISuccessGetCount('Contribution', array('total_amount' => array('<' => 0)), 0);
+ $this->callAPISuccessGetCount('Contribution', array(), 2);
+ }
+
/**
* Create test with unique field name on source.
*/