$expectedValue, $message
) {
$value = CRM_Core_DAO::getFieldValue($daoName, $searchValue, $returnColumn, $searchColumn, TRUE);
- $this->assertEquals($value, $expectedValue, $message);
+ $this->assertEquals($expectedValue, $value, $message);
}
/**
$params = array_merge($defaults, $params);
- if (strlen($params['title']) > 13) {
- $params['title'] = substr($params['title'], 0, 13);
- }
-
//have a crack @ deleting it first in the hope this will prevent derailing our tests
$this->callAPISuccess('custom_group', 'get', array(
'title' => $params['title'],
$var = TRUE;
CRM_Member_BAO_Membership::createRelatedMemberships($var, $var, TRUE);
$this->disableTaxAndInvoicing();
+ $this->setCurrencySeparators(',');
+ CRM_Core_PseudoConstant::flush('taxRates');
System::singleton()->flushProcessors();
}
if (!$isProfile) {
//flush cache
CRM_ACL_BAO_Cache::resetCache();
- CRM_Contact_BAO_Group::getPermissionClause(TRUE);
CRM_ACL_API::groupPermission('whatever', 9999, NULL, 'civicrm_saved_search', NULL, NULL, TRUE);
}
}
protected function setPermissions($permissions) {
CRM_Core_Config::singleton()->userPermissionClass->permissions = $permissions;
$this->flushFinancialTypeStatics();
- CRM_Contact_BAO_Group::getPermissionClause(TRUE);
}
/**
return $form;
}
+ /**
+ * Get possible thousand separators.
+ *
+ * @return array
+ */
+ public function getThousandSeparators() {
+ return array(array('.'), array(','));
+ }
+
+ /**
+ * Set the separators for thousands and decimal points.
+ *
+ * @param string $thousandSeparator
+ */
+ protected function setCurrencySeparators($thousandSeparator) {
+ Civi::settings()->set('monetaryThousandSeparator', $thousandSeparator);
+ Civi::settings()
+ ->set('monetaryDecimalPoint', ($thousandSeparator === ',' ? '.' : ','));
+ }
+
+ /**
+ * Format money as it would be input.
+ *
+ * @param string $amount
+ *
+ * @return string
+ */
+ protected function formatMoneyInput($amount) {
+ return CRM_Utils_Money::format($amount, NULL, '%a');
+ }
+
}