<?php
/*
+--------------------------------------------------------------------+
- | CiviCRM version 4.4 |
+ | CiviCRM version 4.5 |
+--------------------------------------------------------------------+
- | Copyright CiviCRM LLC (c) 2004-2013 |
+ | Copyright CiviCRM LLC (c) 2004-2014 |
+--------------------------------------------------------------------+
| This file is a part of CiviCRM. |
| |
class api_v3_GroupOrganizationTest extends CiviUnitTestCase {
protected $_apiversion;
+ /**
+ * @return array
+ */
function get_info() {
return array(
'name' => 'Group Organization',
protected function setUp() {
$this->_apiversion = 3;
parent::setUp();
- $this->_groupID = $this->groupCreate(NULL);
+ $this->_groupID = $this->groupCreate();
$this->_orgID = $this->organizationCreate(NULL);
}
* Test civicrm_group_organization_get with group_id.
*/
public function testGroupOrganizationGetWithGroupId() {
-
- $params = array(
+ $createParams = array(
'organization_id' => $this->_orgID,
- 'group_id' => $this->_groupID, 'sequential' => 1,
+ 'group_id' => $this->_groupID,
);
- $result = $this->callAPISuccess('group_organization', 'create', $params);
+ $createResult = $this->callAPISuccess('group_organization', 'create', $createParams);
- $paramsGet = array('organization_id' => $result['values'][0]['organization_id']);
-
- $result = $this->callAPISuccess('group_organization', 'get', $params);
- $this->assertAPISuccess($result);
+ $getParams = array(
+ 'group_id' => $this->_groupID,
+ 'sequential' => 1,
+ );
+ $getResult = $this->callAPISuccess('group_organization', 'get', $getParams);
+ $this->assertEquals($createResult['values'], $getResult['values'][0]);
}
/**
///////////////// civicrm_group_organization_create methods
/**
- * check with valid params
+ * Check with valid params
*/
public function testGroupOrganizationCreate() {
$params = array(
$this->assertEquals($result['values'], $result2['values']);
}
/**
- * check with empty params array
+ * Check with empty params array
*/
public function testGroupOrganizationCreateWithEmptyParams() {
$params = array( );
}
/**
- * check with invalid params
+ * Check with invalid params
*/
public function testGroupOrganizationCreateParamsNotArray() {
$params = 'group_org';
}
/**
- * check with invalid params keys
+ * Check with invalid params keys
*/
public function testGroupOrganizationCreateWithInvalidKeys() {
$params = array(