<?php
/*
+--------------------------------------------------------------------+
- | CiviCRM version 4.5 |
+ | CiviCRM version 4.6 |
+--------------------------------------------------------------------+
| Copyright CiviCRM LLC (c) 2004-2014 |
+--------------------------------------------------------------------+
| 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 UFGroup API - civicrm_uf_*
* @todo Split UFGroup and UFJoin tests
*
- * @package CiviCRM
+ * @package CiviCRM
*/
class api_v3_UFJoinTest extends CiviUnitTestCase {
// ids from the uf_group_test.xml fixture
)
);
$this->_apiversion = 3;
- $op = new PHPUnit_Extensions_Database_Operation_Insert;
+ $op = new PHPUnit_Extensions_Database_Operation_Insert();
$op->execute(
$this->_dbconn,
$this->createFlatXMLDataSet(dirname(__FILE__) . '/dataset/uf_group_test.xml')
);
}
- function tearDown() {
+ public function tearDown() {
// Truncate the tables
$this->quickCleanup(
array(
}
/**
- * find uf join group id
+ * Find uf join group id
*/
public function testFindUFGroupId() {
$params = array(
'entity_id' => 1,
'weight' => 1,
'uf_group_id' => $this->_ufGroupId,
- 'is_active' => 1, );
+ 'is_active' => 1,
+ );
$ufJoin = $this->callAPISuccess('uf_join', 'create', $params);
$searchParams = array(
'entity_table' => 'civicrm_contribution_page',
- 'entity_id' => 1, );
+ 'entity_id' => 1,
+ );
$result = $this->callAPISuccess('uf_join', 'get', $searchParams);
foreach ($result['values'] as $key => $value) {
'entity_table' => 'civicrm_contribution_page',
'entity_id' => 1,
'weight' => 1,
- 'is_active' => 1, );
+ 'is_active' => 1,
+ );
$result = $this->callAPIFailure('uf_join', 'create', $params);
$this->assertEquals($result['error_message'], 'Mandatory key(s) missing from params array: uf_group_id', 'In line ' . __LINE__);
}
/**
- * create/update uf join
+ * Create/update uf join
*/
public function testCreateUFJoin() {
$params = array(
'entity_id' => 1,
'weight' => 1,
'uf_group_id' => $this->_ufGroupId,
- 'is_active' => 1, 'sequential' => 1,
+ 'is_active' => 1,
+ 'sequential' => 1,
);
$ufJoin = $this->callAPIAndDocument('uf_join', 'create', $params, __FUNCTION__, __FILE__);
$this->assertEquals($ufJoin['values'][0]['module'], $params['module'], 'In line ' . __LINE__);
'entity_id' => 1,
'weight' => 1,
'uf_group_id' => $this->_ufGroupId,
- 'is_active' => 0, 'sequential' => 1,
+ 'is_active' => 0,
+ 'sequential' => 1,
);
$ufJoinUpdated = $this->callAPISuccess('uf_join', 'create', $params);
$this->assertEquals($ufJoinUpdated['values'][0]['module'], $params['module'], 'In line ' . __LINE__);
}
/**
- * find uf join id
+ * Find uf join id
*/
public function testGetUFJoinId() {
$params = array(
'entity_id' => 1,
'weight' => 1,
'uf_group_id' => $this->_ufGroupId,
- 'is_active' => 1, );
+ 'is_active' => 1,
+ );
$ufJoin = $this->callAPISuccess('uf_join', 'create', $params);
$searchParams = array(
'entity_table' => 'civicrm_contribution_page',
- 'entity_id' => 1, 'sequential' => 1,
+ 'entity_id' => 1,
+ 'sequential' => 1,
);
$result = $this->callAPIAndDocument('uf_join', 'get', $searchParams, __FUNCTION__, __FILE__);
/**
* Test civicrm_activity_create() using example code
*/
- function testUFJoinCreateExample() {
+ public function testUFJoinCreateExample() {
require_once 'api/v3/examples/UFJoin/Create.php';
$result = UF_join_create_example();
$expectedResult = UF_join_create_expectedresult();
$this->assertEquals($result, $expectedResult);
}
-}
+}