+--------------------------------------------------------------------+
| CiviCRM version 4.6 |
+--------------------------------------------------------------------+
- | Copyright CiviCRM LLC (c) 2004-2014 |
+ | Copyright CiviCRM LLC (c) 2004-2015 |
+--------------------------------------------------------------------+
| This file is a part of CiviCRM. |
| |
| GNU Affero General Public License or the licensing of CiviCRM, |
| see the CiviCRM license FAQ at http://civicrm.org/licensing |
+--------------------------------------------------------------------+
-*/
+ */
require_once 'CiviTest/CiviUnitTestCase.php';
}
/**
- * Check checkbox type custom fields are created correctly
+ * Check checkbox type custom fields are created correctly.
+ *
* We want to ensure they are saved with separators as appropriate
*/
public function testCreateCustomCheckboxGrant() {
$savedValue = CRM_Core_DAO::singleValueQuery("SELECT {$columnName} FROM $customTable WHERE entity_id = {$result['id']}");
$this->assertEquals($expectedValue, $savedValue);
- // & check it will do the separating
- $this->params[$customFieldLabel] = 'valley,goat';
- $result = $this->callAPISuccess($this->_entity, 'create', $this->params);
- $savedValue = CRM_Core_DAO::singleValueQuery("SELECT {$columnName} FROM $customTable WHERE entity_id = {$result['id']}");
- $this->assertEquals($expectedValue, $savedValue);
-
- //& here is the odd but previously supported (form-oriented) format
- //& an array for good measure
- $this->params[$customFieldLabel] = array('valley' => 1, 'goat' => 1);
- $result = $this->callAPISuccess($this->_entity, 'create', $this->params);
- $savedValue = CRM_Core_DAO::singleValueQuery("SELECT {$columnName} FROM $customTable WHERE entity_id = {$result['id']}");
- $this->assertEquals($expectedValue, $savedValue);
-
//& an array for good measure
$this->params[$customFieldLabel] = array('valley', 'goat');
$result = $this->callAPISuccess($this->_entity, 'create', $this->params);
}
/**
- * This is a test to check if setting fields one at a time alters other fields
+ * This is a test to check if setting fields one at a time alters other fields.
+ *
* Issues Hit so far =
* 1) Currency keeps getting reset to USD - BUT this may be the only enabled currency
* - in which case it is valid