Coding standards cleanup sprint.
[civicrm-core.git] / tests / phpunit / api / v3 / ImTest.php
index efccb8c87926993730602d5d7b8df9d4d765513b..f36ca49a78714f0481c847f7088e8ecae1a5fd67 100644 (file)
@@ -1,7 +1,7 @@
 <?php
 /*
  +--------------------------------------------------------------------+
- | CiviCRM version 4.5                                                |
+ | CiviCRM version 4.6                                                |
  +--------------------------------------------------------------------+
  | Copyright CiviCRM LLC (c) 2004-2014                                |
  +--------------------------------------------------------------------+
@@ -31,10 +31,9 @@ require_once 'CiviTest/CiviUnitTestCase.php';
 /**
  *  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;
@@ -43,12 +42,13 @@ class api_v3_ImTest extends CiviUnitTestCase {
 
   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,
@@ -56,13 +56,6 @@ class api_v3_ImTest extends CiviUnitTestCase {
     );
   }
 
-  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__);
@@ -85,6 +78,7 @@ class api_v3_ImTest extends CiviUnitTestCase {
     $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);