/**
* Test class for GroupOrganization API - civicrm_group_organization_*
*
- * @package CiviCRM
+ * @package CiviCRM
*/
class api_v3_GroupOrganizationTest 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;
$params = array(
'organization_id' => $this->_orgID,
- 'group_id' => $this->_groupID, );
+ 'group_id' => $this->_groupID,
+ );
$result = $this->callAPISuccess('group_organization', 'create', $params);
$paramsGet = array(
'organization_id' => $result['id'],
* Test civicrm_group_organization_get with empty params.
*/
public function testGroupOrganizationGetWithEmptyParams() {
- $params = array( );
+ $params = array();
$result = $this->callAPISuccess('group_organization', 'get', $params);
$this->assertAPISuccess($result);
*/
public function testGroupOrganizationGetWithInvalidKeys() {
$params = array(
- 'invalid_key' => 1, );
+ 'invalid_key' => 1,
+ );
$result = $this->callAPISuccess('group_organization', 'get', $params);
$this->assertAPISuccess($result);
public function testGroupOrganizationCreate() {
$params = array(
'organization_id' => $this->_orgID,
- 'group_id' => $this->_groupID, );
+ 'group_id' => $this->_groupID,
+ );
$result = $this->callAPIAndDocument('group_organization', 'create', $params, __FUNCTION__, __FILE__);
}
*/
public function testGroupOrganizationCreateTwice() {
$params = array(
- 'organization_id' => $this->_orgID,
- 'group_id' => $this->_groupID, );
+ 'organization_id' => $this->_orgID,
+ 'group_id' => $this->_groupID,
+ );
$result = $this->callAPISuccess('group_organization', 'create', $params);
$result2 = $this->callAPISuccess('group_organization', 'create', $params);
$this->assertEquals($result['values'], $result2['values']);
}
+
/**
* Check with empty params array
*/
public function testGroupOrganizationCreateWithEmptyParams() {
- $params = array( );
+ $params = array();
$result = $this->callAPIFailure('group_organization', 'create', $params);
$this->assertEquals($result['error_message'], 'Mandatory key(s) missing from params array: group_id, organization_id');
}
*/
public function testGroupOrganizationCreateWithInvalidKeys() {
$params = array(
- 'invalid_key' => 1, );
+ 'invalid_key' => 1,
+ );
$result = $this->callAPIFailure('group_organization', 'create', $params);
$this->assertEquals($result['error_message'], 'Mandatory key(s) missing from params array: group_id, organization_id');
}
* Test civicrm_group_organization_remove with empty params.
*/
public function testGroupOrganizationDeleteWithEmptyParams() {
- $params = array( );
+ $params = array();
$result = $this->callAPIFailure('group_organization', 'delete', $params);
$this->assertEquals($result['error_message'], 'Mandatory key(s) missing from params array: id');
}
public function testGroupOrganizationDelete() {
$paramsC = array(
'organization_id' => $this->_orgID,
- 'group_id' => $this->_groupID, );
+ 'group_id' => $this->_groupID,
+ );
$result = $this->callAPISuccess('group_organization', 'create', $paramsC);
$params = array(
*/
public function testGroupOrganizationDeleteWithInvalidKey() {
$paramsDelete = array(
- 'invalid_key' => 1, );
+ 'invalid_key' => 1,
+ );
$result = $this->callAPIFailure('group_organization', 'delete', $paramsDelete);
$this->assertEquals($result['error_message'], 'Mandatory key(s) missing from params array: id');
}
}
-