<?php
/*
+--------------------------------------------------------------------+
- | CiviCRM version 4.5 |
+ | CiviCRM version 4.6 |
+--------------------------------------------------------------------+
| Copyright CiviCRM LLC (c) 2004-2014 |
+--------------------------------------------------------------------+
/**
* Test APIv3 civicrm_im_* functions
*
- * @package CiviCRM_APIv3
- * @subpackage API_Contact
+ * @package CiviCRM_APIv3
+ * @subpackage API_Contact
*/
-
class api_v3_ImTest extends CiviUnitTestCase {
protected $_apiversion = 3;
protected $params;
public $DBResetRequired = FALSE;
- function setUp() {
+ public function setUp() {
parent::setUp();
+ $this->useTransaction(TRUE);
- $this->_entity = 'im';
- $this->_contactID = $this->organizationCreate();
- $this->params = array(
+ $this->_entity = 'im';
+ $this->_contactID = $this->organizationCreate();
+ $this->params = array(
'contact_id' => $this->_contactID,
'name' => 'My Yahoo IM Handle',
'location_type_id' => 1,
);
}
- function tearDown() {
- $this->quickCleanup(array(
- 'civicrm_im',
- 'civicrm_contact'
- ));
- }
-
public function testCreateIm() {
$result = $this->callAPIAndDocument($this->_entity, 'create', $this->params, __FUNCTION__, __FILE__);
$this->assertEquals(1, $result['count'], 'In line ' . __LINE__);
$checkDeleted = $this->callAPISuccess($this->_entity, 'get', array());
$this->assertEquals(0, $checkDeleted['count'], 'In line ' . __LINE__);
}
+
public function testDeleteImInvalid() {
$result = $this->callAPISuccess($this->_entity, 'create', $this->params);
$deleteParams = array('id' => 600);