Merge pull request #5536 from totten/4.5-httpclient
[civicrm-core.git] / tests / phpunit / api / v3 / GroupTest.php
index cd0bf6fcb46ce7c30acab8911fff5504dd94902c..d8cfae46ca5121722914b21d9ba2a0623b673f37 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.                                    |
  |                                                                    |
  | 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';
 
 /**
  * Test class for Group API - civicrm_group_*
  *
- *  @package CiviCRM_APIv3
+ * @package CiviCRM_APIv3
  */
-
 class api_v3_GroupTest extends CiviUnitTestCase {
   protected $_apiversion;
   protected $_groupID;
 
-  /**
-   * @return array
-   */
-  function get_info() {
-    return array(
-      'name' => 'Group Get',
-      'description' => 'Test all Group Get API methods.',
-      'group' => 'CiviCRM API Tests',
-    );
-  }
-
-  function setUp() {
+  public function setUp() {
     $this->_apiversion = 3;
 
     parent::setUp();
     $this->_groupID = $this->groupCreate();
   }
 
-  function tearDown() {
+  public function tearDown() {
 
     $this->groupDelete($this->_groupID);
   }
 
-  function testgroupCreateNoTitle() {
+  public function testgroupCreateNoTitle() {
     $params = array(
       'name' => 'Test Group No title ',
       'domain_id' => 1,
@@ -77,7 +65,7 @@ class api_v3_GroupTest extends CiviUnitTestCase {
   }
 
 
-  function testGetGroupWithEmptyParams() {
+  public function testGetGroupWithEmptyParams() {
     $group = $this->callAPISuccess('group', 'get', $params = array());
 
     $group = $group["values"];
@@ -87,7 +75,7 @@ class api_v3_GroupTest extends CiviUnitTestCase {
     $this->assertEquals($group[$this->_groupID]['visibility'], 'Public Pages');
   }
 
-  function testGetGroupParamsWithGroupId() {
+  public function testGetGroupParamsWithGroupId() {
     $params = array('id' => $this->_groupID);
     $group = $this->callAPISuccess('group', 'get', $params);
 
@@ -100,7 +88,7 @@ class api_v3_GroupTest extends CiviUnitTestCase {
     }
   }
 
-  function testGetGroupParamsWithGroupName() {
+  public function testGetGroupParamsWithGroupName() {
     $params = array(
       'name' => "Test Group 1",
     );
@@ -116,7 +104,7 @@ class api_v3_GroupTest extends CiviUnitTestCase {
     }
   }
 
-  function testGetGroupParamsWithReturnName() {
+  public function testGetGroupParamsWithReturnName() {
     $params = array();
     $params['id'] = $this->_groupID;
     $params['return.name'] = 1;
@@ -126,7 +114,7 @@ class api_v3_GroupTest extends CiviUnitTestCase {
     );
   }
 
-  function testGetGroupParamsWithGroupTitle() {
+  public function testGetGroupParamsWithGroupTitle() {
     $params = array();
     $params['title'] = 'New Test Group Created';
     $group = $this->callAPISuccess('group', 'get', $params);
@@ -140,22 +128,22 @@ class api_v3_GroupTest extends CiviUnitTestCase {
     }
   }
 
-  function testGetNonExistingGroup() {
+  public function testGetNonExistingGroup() {
     $params = array();
     $params['title'] = 'No such group Exist';
     $group = $this->callAPISuccess('group', 'get', $params);
     $this->assertEquals(0, $group['count']);
   }
 
-  function testgroupdeleteParamsnoId() {
+  public function testgroupdeleteParamsnoId() {
     $group = $this->callAPIFailure('group', 'delete', array(), 'Mandatory key(s) missing from params array: id');
   }
 
-  function testgetfields() {
-    $description = "demonstrate use of getfields to interrogate api";
+  public function testgetfields() {
+    $description = "Demonstrate use of getfields to interrogate api.";
     $params = array('action' => 'create');
-    $result = $this->callAPIAndDocument('group', 'getfields', $params, __FUNCTION__, __FILE__, $description, 'getfields', 'getfields');
+    $result = $this->callAPIAndDocument('group', 'getfields', $params, __FUNCTION__, __FILE__, $description);
     $this->assertEquals(1, $result['values']['is_active']['api.default']);
   }
-}
 
+}