<?php
/*
+--------------------------------------------------------------------+
- | CiviCRM version 5 |
- +--------------------------------------------------------------------+
- | Copyright CiviCRM LLC (c) 2004-2019 |
- +--------------------------------------------------------------------+
- | This file is a part of CiviCRM. |
- | |
- | CiviCRM is free software; you can copy, modify, and distribute it |
- | under the terms of the GNU Affero General Public License |
- | Version 3, 19 November 2007 and the CiviCRM Licensing Exception. |
- | |
- | CiviCRM is distributed in the hope that it will be useful, but |
- | WITHOUT ANY WARRANTY; without even the implied warranty of |
- | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
- | See the GNU Affero General Public License for more details. |
+ | Copyright CiviCRM LLC. All rights reserved. |
| |
- | You should have received a copy of the GNU Affero General Public |
- | License and the CiviCRM Licensing Exception along |
- | with this program; if not, contact CiviCRM LLC |
- | at info[AT]civicrm[DOT]org. If you have questions about the |
- | GNU Affero General Public License or the licensing of CiviCRM, |
- | see the CiviCRM license FAQ at http://civicrm.org/licensing |
+ | This work is published under the GNU AGPLv3 license with some |
+ | permitted exceptions and without any warranty. For full license |
+ | and copyright information, see https://civicrm.org/licensing |
+--------------------------------------------------------------------+
*/
$this->_groupId = $this->groupCreate();
$this->_contactId = $this->individualCreate();
$this->createLoggedInUser();
- $ufGroup = $this->callAPISuccess('uf_group', 'create', array(
+ $ufGroup = $this->callAPISuccess('uf_group', 'create', [
'group_type' => 'Contact',
'help_pre' => 'Profile to Test API',
'title' => 'Test Profile',
- ));
+ ]);
$this->_ufGroupId = $ufGroup['id'];
- $ufMatch = $this->callAPISuccess('uf_match', 'create', array(
+ $ufMatch = $this->callAPISuccess('uf_match', 'create', [
'contact_id' => $this->_contactId,
'uf_id' => 42,
'uf_name' => 'email@mail.com',
- ));
+ ]);
$this->_ufMatchId = $ufMatch['id'];
- $this->params = array(
+ $this->params = [
'add_captcha' => 1,
'add_contact_to_group' => $this->_groupId,
'group' => $this->_groupId,
'notify' => 'admin@example.org',
'post_URL' => 'http://example.org/post',
'title' => 'Test Group',
- );
+ ];
}
public function tearDown() {
// Truncate the tables
$this->quickCleanup(
- array(
+ [
'civicrm_group',
'civicrm_contact',
'civicrm_uf_group',
'civicrm_uf_join',
'civicrm_uf_match',
- )
+ ]
);
}
*/
public function testUpdateUFGroup($version) {
$this->_apiversion = $version;
- $params = array(
+ $params = [
'title' => 'Edited Test Profile',
'help_post' => 'Profile Pro help text.',
'is_active' => 1,
'id' => $this->_ufGroupId,
- );
+ ];
$result = $this->callAPISuccess('uf_group', 'create', $params);
foreach ($params as $key => $value) {
*/
public function testUFGroupCreateWithWrongParams($version) {
$this->_apiversion = $version;
- $result = $this->callAPIFailure('uf_group', 'create', array('name' => 'A title-less group'));
+ $result = $this->callAPIFailure('uf_group', 'create', ['name' => 'A title-less group']);
}
/**
*/
public function testUFGroupUpdate($version) {
$this->_apiversion = $version;
- $params = array(
+ $params = [
'id' => $this->_ufGroupId,
'add_captcha' => 1,
'add_contact_to_group' => $this->_groupId,
'notify' => 'admin@example.org',
'post_URL' => 'http://example.org/post',
'title' => 'Test Group',
- );
+ ];
$result = $this->callAPISuccess('uf_group', 'create', $params);
$params['created_date'] = date('YmdHis', strtotime($params['created_date']));
foreach ($params as $key => $value) {
public function testUFGroupGet($version) {
$this->_apiversion = $version;
$result = $this->callAPISuccess('uf_group', 'create', $this->params);
- $params = array('id' => $result['id']);
+ $params = ['id' => $result['id']];
$result = $this->callAPIAndDocument('uf_group', 'get', $params, __FUNCTION__, __FILE__);
$this->assertEquals($result['values'][$result['id']]['add_to_group_id'], $this->params['add_contact_to_group']);
$this->assertEquals($result['values'][$result['id']]['limit_listings_group_id'], $this->params['group']);
public function testUFGroupDelete($version) {
$this->_apiversion = $version;
$ufGroup = $this->callAPISuccess('uf_group', 'create', $this->params);
- $params = array('id' => $ufGroup['id']);
+ $params = ['id' => $ufGroup['id']];
$this->assertEquals(1, $this->callAPISuccess('uf_group', 'getcount', $params), "in line " . __LINE__);
$result = $this->callAPIAndDocument('uf_group', 'delete', $params, __FUNCTION__, __FILE__);
$this->assertEquals(0, $this->callAPISuccess('uf_group', 'getcount', $params), "in line " . __LINE__);