Merge pull request #5536 from totten/4.5-httpclient
[civicrm-core.git] / tests / phpunit / api / v3 / GrantTest.php
index de1e20dee86ba1363fbcfeb279b062e7d0d76813..a581bd499f5599a85c620e16185c3e88c1bc06d7 100644 (file)
@@ -3,7 +3,7 @@
  +--------------------------------------------------------------------+
  | CiviCRM version 4.6                                                |
  +--------------------------------------------------------------------+
- | Copyright CiviCRM LLC (c) 2004-2014                                |
+ | Copyright CiviCRM LLC (c) 2004-2015                                |
  +--------------------------------------------------------------------+
  | This file is a part of CiviCRM.                                    |
  |                                                                    |
@@ -23,7 +23,7 @@
  | 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';
 
@@ -74,7 +74,8 @@ class api_v3_GrantTest extends CiviUnitTestCase {
   }
 
   /**
-   * 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() {
@@ -90,7 +91,7 @@ class api_v3_GrantTest extends CiviUnitTestCase {
         array('label' => 'my goat', 'value' => 'goat', 'is_active' => TRUE, 'weight' => 2),
         array('label' => 'mohair', 'value' => 'wool', 'is_active' => TRUE, 'weight' => 3),
         array('label' => 'hungry', 'value' => '', 'is_active' => TRUE, 'weight' => 3),
-      )
+      ),
     ));
     $columnName = $result['values'][$result['id']]['column_name'];
     $ids['custom_field_id'] = $result['id'];
@@ -118,19 +119,6 @@ class api_v3_GrantTest extends CiviUnitTestCase {
     $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);
@@ -157,14 +145,14 @@ class api_v3_GrantTest extends CiviUnitTestCase {
     $this->assertEquals(0, $checkDeleted['count'], 'In line ' . __LINE__);
   }
 
-  /*
-  * 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
-  * 2)
-  */
-
+  /**
+   * 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
+   * 2)
+   */
   public function testCreateAutoGrant() {
     $entityName = $this->_entity;
     $baoString = 'CRM_Grant_BAO_Grant';
@@ -242,4 +230,5 @@ class api_v3_GrantTest extends CiviUnitTestCase {
     $baoObj->deleteTestObjects($baoString);
     $baoObj->free();
   }
+
 }