api_v3_GroupContactTest - Change quickCleanup() to useTransaction()
authorTim Otten <totten@civicrm.org>
Mon, 22 Dec 2014 21:24:54 +0000 (13:24 -0800)
committerTim Otten <totten@civicrm.org>
Mon, 22 Dec 2014 22:07:26 +0000 (14:07 -0800)
tests/phpunit/api/v3/GroupContactTest.php

index 78be1bf83adfbdbf15e2539dd5dffd79478184c6..928081944c1aa5fd23cf4ff2af477c99980ef541 100644 (file)
@@ -57,6 +57,7 @@ class api_v3_GroupContactTest extends CiviUnitTestCase {
    */
   function setUp() {
     parent::setUp();
+    $this->useTransaction(TRUE);
 
     $this->_contactId = $this->individualCreate();
 
@@ -92,14 +93,6 @@ class api_v3_GroupContactTest extends CiviUnitTestCase {
     );
   }
 
-  function tearDown() {
-    $tablesToTruncate = array(
-      'civicrm_contact',
-      'civicrm_group',
-    );
-    $this->quickCleanup($tablesToTruncate);
-  }
-
   ///////////////// civicrm_group_contact_get methods
   function testGet() {
     $params = array(
@@ -179,7 +172,7 @@ class api_v3_GroupContactTest extends CiviUnitTestCase {
   function testDelete() {
     $params = array(
       'contact_id' => $this->_contactId,
-      'group_id' => 1,
+      'group_id' => $this->_groupId1,
     );
 
     $result = $this->callAPIAndDocument('group_contact', 'delete', $params, __FUNCTION__, __FILE__);