/**
* Test class for GroupNesting API - civicrm_group_nesting_*
*
- * @package CiviCRM
+ * @package CiviCRM
*/
class api_v3_GroupNestingTest extends CiviUnitTestCase {
protected $_apiversion;
/**
* Sets up the fixture, for example, opens a network connection.
* This method is called before a test is executed.
- *
- * @access protected
*/
protected function setUp() {
$this->_apiversion = 3;
/**
* Tears down the fixture, for example, closes a network connection.
* This method is called after a test is executed.
- *
- * @access protected
*/
protected function tearDown() {
// Truncate the tables
$result = $this->callAPIAndDocument('group_nesting', 'get', $params, __FUNCTION__, __FILE__);
// expected data loaded in setUp
$expected = array(
- 1 => array('id' => 1,
+ 1 => array(
+ 'id' => 1,
'child_group_id' => 2,
'parent_group_id' => 1,
- ));
+ )
+ );
$this->assertEquals($expected, $result['values']);
}
*/
public function testGetWithChildGroupId() {
$params = array(
- 'child_group_id' => 4, );
+ 'child_group_id' => 4,
+ );
$result = $this->callAPISuccess('group_nesting', 'get', $params);
// expected data loaded in setUp
$expected = array(
- 3 => array('id' => 3,
+ 3 => array(
+ 'id' => 3,
'child_group_id' => 4,
'parent_group_id' => 1,
),
*/
public function testGetWithParentGroupId() {
$params = array(
- 'parent_group_id' => 1, );
+ 'parent_group_id' => 1,
+ );
$result = $this->callAPISuccess('group_nesting', 'get', $params);
// expected data loaded in setUp
$expected = array(
- 1 => array('id' => 1,
+ 1 => array(
+ 'id' => 1,
'child_group_id' => 2,
'parent_group_id' => 1,
),
// groups id=1 and id=2 loaded in setUp
$getparams = array(
'parent_group_id' => 1,
- 'child_group_id' => 2, );
+ 'child_group_id' => 2,
+ );
$result = $this->callAPISuccess('group_nesting', 'get', $getparams);
$params = array('id' => $result['id']);
$result = $this->callAPIFailure('group_nesting', 'delete', array());
}
}
-