CRM-15011 - tests - Fix dbunit references
authorTim Otten <totten@civicrm.org>
Tue, 22 Jul 2014 07:35:55 +0000 (00:35 -0700)
committerTim Otten <totten@civicrm.org>
Thu, 7 Aug 2014 19:08:01 +0000 (12:08 -0700)
15 files changed:
tests/phpunit/CRM/Activity/BAO/ActivityTest.php
tests/phpunit/CRM/Contact/BAO/QueryTest.php
tests/phpunit/CRM/Contact/Form/Search/Custom/GroupTest.php
tests/phpunit/CRM/Core/BAO/IMTest.php
tests/phpunit/CRM/Mailing/BAO/QueryTest.php
tests/phpunit/CRM/Member/Form/MembershipTest.php
tests/phpunit/CRM/Utils/DeprecatedUtilsTest.php
tests/phpunit/CiviTest/CiviUnitTestCase.php
tests/phpunit/api/v3/ContactTest.php
tests/phpunit/api/v3/GroupNestingTest.php
tests/phpunit/api/v3/MailingContactTest.php
tests/phpunit/api/v3/ProfileTest.php
tests/phpunit/api/v3/UFFieldTest.php
tests/phpunit/api/v3/UFJoinTest.php
tests/phpunit/api/v3/UFMatchTest.php

index 41c767ff13fb11aca25105aca82de3950f315aa4..98886b59e167c1ba86297481e0dfc32ba7e6a662 100644 (file)
@@ -285,7 +285,7 @@ class CRM_Activity_BAO_ActivityTest extends CiviUnitTestCase {
   function testGetActivitiesCountforAdminDashboard() {
     $op = new PHPUnit_Extensions_Database_Operation_Insert();
     $op->execute($this->_dbconn,
-      new PHPUnit_Extensions_Database_DataSet_FlatXMLDataSet(
+      $this->createFlatXMLDataSet(
         dirname(__FILE__) . '/activities_for_dashboard_count.xml'
       )
     );
@@ -314,7 +314,7 @@ class CRM_Activity_BAO_ActivityTest extends CiviUnitTestCase {
   function testGetActivitiesCountforNonAdminDashboard() {
     $op = new PHPUnit_Extensions_Database_Operation_Insert();
     $op->execute($this->_dbconn,
-      new PHPUnit_Extensions_Database_DataSet_FlatXMLDataSet(
+      $this->createFlatXMLDataSet(
         dirname(__FILE__) . '/activities_for_dashboard_count.xml'
       )
     );
@@ -344,7 +344,7 @@ class CRM_Activity_BAO_ActivityTest extends CiviUnitTestCase {
   function testGetActivitiesCountforContactSummary() {
     $op = new PHPUnit_Extensions_Database_Operation_Insert();
     $op->execute($this->_dbconn,
-      new PHPUnit_Extensions_Database_DataSet_FlatXMLDataSet(
+      $this->createFlatXMLDataSet(
         dirname(__FILE__) . '/activities_for_dashboard_count.xml'
       )
     );
@@ -373,7 +373,7 @@ class CRM_Activity_BAO_ActivityTest extends CiviUnitTestCase {
   function testGetActivitiesCountforContactSummaryWithNoActivities() {
     $op = new PHPUnit_Extensions_Database_Operation_Insert();
     $op->execute($this->_dbconn,
-      new PHPUnit_Extensions_Database_DataSet_FlatXMLDataSet(
+      $this->createFlatXMLDataSet(
         dirname(__FILE__) . '/activities_for_dashboard_count.xml'
       )
     );
@@ -401,7 +401,7 @@ class CRM_Activity_BAO_ActivityTest extends CiviUnitTestCase {
   function testGetActivitiesforAdminDashboard() {
     $op = new PHPUnit_Extensions_Database_Operation_Insert();
     $op->execute($this->_dbconn,
-      new PHPUnit_Extensions_Database_DataSet_FlatXMLDataSet(
+      $this->createFlatXMLDataSet(
         dirname(__FILE__) . '/activities_for_dashboard_count.xml'
       )
     );
@@ -436,7 +436,7 @@ class CRM_Activity_BAO_ActivityTest extends CiviUnitTestCase {
   function testGetActivitiesforNonAdminDashboard() {
     $op = new PHPUnit_Extensions_Database_Operation_Insert();
     $op->execute($this->_dbconn,
-      new PHPUnit_Extensions_Database_DataSet_FlatXMLDataSet(
+      $this->createFlatXMLDataSet(
         dirname(__FILE__) . '/activities_for_dashboard_count.xml'
       )
     );
@@ -479,7 +479,7 @@ class CRM_Activity_BAO_ActivityTest extends CiviUnitTestCase {
   function testGetActivitiesforContactSummary() {
     $op = new PHPUnit_Extensions_Database_Operation_Insert();
     $op->execute($this->_dbconn,
-      new PHPUnit_Extensions_Database_DataSet_FlatXMLDataSet(
+      $this->createFlatXMLDataSet(
         dirname(__FILE__) . '/activities_for_dashboard_count.xml'
       )
     );
@@ -534,7 +534,7 @@ class CRM_Activity_BAO_ActivityTest extends CiviUnitTestCase {
   function testGetActivitiesforContactSummaryWithNoActivities() {
     $op = new PHPUnit_Extensions_Database_Operation_Insert();
     $op->execute($this->_dbconn,
-      new PHPUnit_Extensions_Database_DataSet_FlatXMLDataSet(
+      $this->createFlatXMLDataSet(
         dirname(__FILE__) . '/activities_for_dashboard_count.xml'
       )
     );
index 5899e68a3ddfbd0c4d81ff837bd403429107bb20..03e32efc076af3947e0b9528877432eb0bf57590 100644 (file)
@@ -47,7 +47,7 @@ class CRM_Contact_BAO_QueryTest extends CiviUnitTestCase {
   function testSearch($fv, $count, $ids, $full) {
     $op = new PHPUnit_Extensions_Database_Operation_Insert();
     $op->execute($this->_dbconn,
-      new PHPUnit_Extensions_Database_DataSet_FlatXMLDataSet(
+      $this->createFlatXMLDataSet(
         dirname(__FILE__) . '/queryDataset.xml'
       )
     );
index 1af3b27206eebf7f08fa29b1fbcac68846619678..0bf7faa9cf3f8e13a1367110373058376ab17634 100644 (file)
@@ -101,7 +101,7 @@ class CRM_Contact_Form_Search_Custom_GroupTest extends CiviUnitTestCase {
     // echo "testCount\n";
     $op = new PHPUnit_Extensions_Database_Operation_Insert();
     $op->execute($this->_dbconn,
-      new PHPUnit_Extensions_Database_DataSet_FlatXMLDataSet(
+      $this->createFlatXMLDataSet(
         dirname(__FILE__) . '/dataset.xml'
       )
     );
@@ -132,7 +132,7 @@ class CRM_Contact_Form_Search_Custom_GroupTest extends CiviUnitTestCase {
     // echo "testAll\n";
     $op = new PHPUnit_Extensions_Database_Operation_Insert();
     $op->execute($this->_dbconn,
-      new PHPUnit_Extensions_Database_DataSet_FlatXMLDataSet(
+      $this->createFlatXMLDataSet(
         dirname(__FILE__) . '/dataset.xml'
       )
     );
@@ -163,7 +163,7 @@ class CRM_Contact_Form_Search_Custom_GroupTest extends CiviUnitTestCase {
     // echo "testContactIDs\n";
     $op = new PHPUnit_Extensions_Database_Operation_Insert();
     $op->execute($this->_dbconn,
-      new PHPUnit_Extensions_Database_DataSet_FlatXMLDataSet(
+      $this->createFlatXMLDataSet(
         dirname(__FILE__) . '/dataset.xml'
       )
     );
index f3a45feb5d55325c05449ce7e654aba601605161..22735a36d8a4db8a2ec5ea1b3dfaa3dd13df81f7 100644 (file)
@@ -69,7 +69,7 @@ class CRM_Core_BAO_IMTest extends CiviUnitTestCase {
     $op = new PHPUnit_Extensions_Database_Operation_Insert;
     $op->execute(
       $this->_dbconn,
-      new PHPUnit_Extensions_Database_DataSet_FlatXMLDataSet(dirname(__FILE__) . '/dataset/im_test.xml')
+      $this->createFlatXMLDataSet(dirname(__FILE__) . '/dataset/im_test.xml')
     );
 
     $contactId = 69;
index 72b38be28e4842c4c0a122e804c6643610cb8a76..6a4c24bbafc50c3d53ebef25df08d5956392b7a4 100644 (file)
@@ -53,7 +53,7 @@ class CRM_Mailing_BAO_QueryTest extends CiviUnitTestCase {
   function testSearch($fv, $count, $ids, $full) {
     $op = new PHPUnit_Extensions_Database_Operation_Insert();
     $op->execute($this->_dbconn,
-      new PHPUnit_Extensions_Database_DataSet_FlatXMLDataSet(
+      $this->createFlatXMLDataSet(
         dirname(__FILE__) . '/queryDataset.xml'
       )
     );
index 0c59467321cd57419754e3c96bbcf17cc33060d5..d6db032709f2ae665abb2fdb2c367cd99ccc83a8 100644 (file)
@@ -199,7 +199,7 @@ class CRM_Member_Form_MembershipTest extends CiviUnitTestCase {
     //  Insert test data
     $op = new PHPUnit_Extensions_Database_Operation_Insert();
     $op->execute($this->_dbconn,
-      new PHPUnit_Extensions_Database_DataSet_FlatXMLDataSet(
+      $this->createFlatXMLDataSet(
         dirname(__FILE__) . '/dataset/data.xml'
       )
     );
index 6405ce5cea1f216d09d6118f6ad03fcecc683bb8..b9f2236a2a990f854be3834876162d397e2f3b47 100644 (file)
@@ -50,12 +50,12 @@ class CRM_Utils_DeprecatedUtilsTest extends CiviUnitTestCase {
     //  Insert a row in civicrm_contact creating individual contact
     $op = new PHPUnit_Extensions_Database_Operation_Insert();
     $op->execute($this->_dbconn,
-        new PHPUnit_Extensions_Database_DataSet_XMLDataSet(
+        $this->createXMLDataSet(
             dirname(__FILE__) . '/../../api/v3/dataset/contact_17.xml'
         )
     );
     $op->execute($this->_dbconn,
-        new PHPUnit_Extensions_Database_DataSet_XMLDataSet(
+        $this->createXMLDataSet(
             dirname(__FILE__) . '/../../api/v3/dataset/email_contact_17.xml'
         )
     );
@@ -82,12 +82,12 @@ class CRM_Utils_DeprecatedUtilsTest extends CiviUnitTestCase {
     //  Insert a row in civicrm_contact creating individual contact
     $op = new PHPUnit_Extensions_Database_Operation_Insert();
     $op->execute($this->_dbconn,
-        new PHPUnit_Extensions_Database_DataSet_XMLDataSet(
+        $this->createXMLDataSet(
             dirname(__FILE__) . '/../../api/v3/dataset/contact_17.xml'
         )
     );
     $op->execute($this->_dbconn,
-        new PHPUnit_Extensions_Database_DataSet_XMLDataSet(
+        $this->createXMLDataSet(
             dirname(__FILE__) . '/../../api/v3/dataset/email_contact_17.xml'
         )
     );
index 6e2ce21d965ce549da64cb286c881e5096415188..d4a75d8ec44f29dc861b230e8618632f0a921f58 100644 (file)
@@ -386,7 +386,7 @@ class CiviUnitTestCase extends PHPUnit_Extensions_Database_TestCase {
     $xmlFiles = glob($fixturesDir . '/*.xml');
     foreach ($xmlFiles as $xmlFixture) {
       $op = new PHPUnit_Extensions_Database_Operation_Insert();
-      $dataset = new PHPUnit_Extensions_Database_DataSet_XMLDataSet($xmlFixture);
+      $dataset = $this->createXMLDataSet($xmlFixture);
       $this->_tablesToTruncate = array_merge($this->_tablesToTruncate, $dataset->getTableNames());
       $op->execute($this->_dbconn, $dataset);
     }
index bdf8f60d9abd5bd8d07e0393c01c6d8ce7366eed..ff46898e4022e20272376a0d44be1f4591c7155c 100644 (file)
@@ -871,7 +871,7 @@ class api_v3_ContactTest extends CiviUnitTestCase {
     //  Insert a row in civicrm_contact creating individual contact
     $op = new PHPUnit_Extensions_Database_Operation_Insert();
     $op->execute($this->_dbconn,
-      new PHPUnit_Extensions_Database_DataSet_XMLDataSet(
+      $this->createXMLDataSet(
         dirname(__FILE__) . '/dataset/contact_ind.xml'
       )
     );
@@ -902,10 +902,10 @@ class api_v3_ContactTest extends CiviUnitTestCase {
       $this->assertEquals($value, $getResult['values'][23][$key]);
     }
     //  Check updated civicrm_contact against expected
-    $expected = new PHPUnit_Extensions_Database_DataSet_XMLDataSet(
+    $expected = $this->createXMLDataSet(
       dirname(__FILE__) . '/dataset/contact_ind_upd.xml'
     );
-    $actual = new PHPUnit_Extensions_Database_DataSet_QueryDataset(
+    $actual = new PHPUnit_Extensions_Database_DataSet_QueryDataSet(
       $this->_dbconn
     );
     $actual->addTable('civicrm_contact');
@@ -919,7 +919,7 @@ class api_v3_ContactTest extends CiviUnitTestCase {
     //  Insert a row in civicrm_contact creating organization contact
     $op = new PHPUnit_Extensions_Database_Operation_Insert();
     $op->execute($this->_dbconn,
-      new PHPUnit_Extensions_Database_DataSet_XMLDataSet(
+      $this->createXMLDataSet(
         dirname(__FILE__) . '/dataset/contact_org.xml'
       )
     );
@@ -935,10 +935,10 @@ class api_v3_ContactTest extends CiviUnitTestCase {
     $this->callAPISuccess('Contact', 'Update', $params);
 
     //  Check updated civicrm_contact against expected
-    $expected = new PHPUnit_Extensions_Database_DataSet_XMLDataSet(
+    $expected = $this->createXMLDataSet(
       dirname(__FILE__) . '/dataset/contact_org_upd.xml'
     );
-    $actual = new PHPUnit_Extensions_Database_DataSet_QueryDataset(
+    $actual = new PHPUnit_Extensions_Database_DataSet_QueryDataSet(
       $this->_dbconn
     );
     $actual->addTable('civicrm_contact');
@@ -952,7 +952,7 @@ class api_v3_ContactTest extends CiviUnitTestCase {
     //  Insert a row in civicrm_contact creating household contact
     $op = new PHPUnit_Extensions_Database_Operation_Insert();
     $op->execute($this->_dbconn,
-      new PHPUnit_Extensions_Database_DataSet_XMLDataSet(
+      $this->createXMLDataSet(
         dirname(__FILE__) . '/dataset/contact_hld.xml'
       )
     );
@@ -985,7 +985,7 @@ class api_v3_ContactTest extends CiviUnitTestCase {
     //  Insert a row in civicrm_contact creating individual contact
     $op = new PHPUnit_Extensions_Database_Operation_Insert();
     $op->execute($this->_dbconn,
-      new PHPUnit_Extensions_Database_DataSet_XMLDataSet(
+      $this->createXMLDataSet(
         dirname(__FILE__) . '/dataset/contact_ind.xml'
       )
     );
@@ -1109,12 +1109,12 @@ class api_v3_ContactTest extends CiviUnitTestCase {
     //  Insert a row in civicrm_contact creating individual contact
     $op = new PHPUnit_Extensions_Database_Operation_Insert();
     $op->execute($this->_dbconn,
-      new PHPUnit_Extensions_Database_DataSet_XMLDataSet(
+      $this->createXMLDataSet(
         dirname(__FILE__) . '/dataset/contact_17.xml'
       )
     );
     $op->execute($this->_dbconn,
-      new PHPUnit_Extensions_Database_DataSet_XMLDataSet(
+      $this->createXMLDataSet(
         dirname(__FILE__) . '/dataset/email_contact_17.xml'
       )
     );
@@ -1140,7 +1140,7 @@ class api_v3_ContactTest extends CiviUnitTestCase {
     //  Insert a row in civicrm_contact creating contact 17
     $op = new PHPUnit_Extensions_Database_Operation_Insert();
     $op->execute($this->_dbconn,
-      new PHPUnit_Extensions_Database_DataSet_XMLDataSet(
+      $this->createXMLDataSet(
         dirname(__FILE__) . '/dataset/contact_17.xml'
       )
     );
@@ -1159,7 +1159,7 @@ class api_v3_ContactTest extends CiviUnitTestCase {
     //  Insert a row in civicrm_contact creating contact 17
     $op = new PHPUnit_Extensions_Database_Operation_Insert();
     $op->execute($this->_dbconn,
-      new PHPUnit_Extensions_Database_DataSet_XMLDataSet(dirname(__FILE__) . '/dataset/contact_17.xml'
+      $this->createXMLDataSet(dirname(__FILE__) . '/dataset/contact_17.xml'
       )
     );
 
@@ -1683,7 +1683,7 @@ class api_v3_ContactTest extends CiviUnitTestCase {
     //  Insert a row in civicrm_contact creating contact 17
     $op = new PHPUnit_Extensions_Database_Operation_Insert();
     $op->execute($this->_dbconn,
-      new PHPUnit_Extensions_Database_DataSet_XMLDataSet(
+      $this->createXMLDataSet(
         dirname(__FILE__) . '/dataset/contact_17.xml'
       )
     );
index cc43ccaa179855fe2659b0c0d1f4dfa8e3afa685..0597397e501dcb058a40693a3bb1304e5cecdfd6 100644 (file)
@@ -50,7 +50,7 @@ class api_v3_GroupNestingTest extends CiviUnitTestCase {
     //  from_email_address group
     $op = new PHPUnit_Extensions_Database_Operation_Insert();
     $op->execute($this->_dbconn,
-      new PHPUnit_Extensions_Database_DataSet_XMLDataSet(
+      $this->createXMLDataSet(
         dirname(__FILE__) . '/dataset/group_admins.xml'
       )
     );
@@ -59,7 +59,7 @@ class api_v3_GroupNestingTest extends CiviUnitTestCase {
     //  from_email_address group
     $op = new PHPUnit_Extensions_Database_Operation_Insert();
     $op->execute($this->_dbconn,
-      new PHPUnit_Extensions_Database_DataSet_XMLDataSet(
+      $this->createXMLDataSet(
         dirname(__FILE__) . '/dataset/group_subscribers.xml'
       )
     );
@@ -68,7 +68,7 @@ class api_v3_GroupNestingTest extends CiviUnitTestCase {
     //  from_email_address group
     $op = new PHPUnit_Extensions_Database_Operation_Insert();
     $op->execute($this->_dbconn,
-      new PHPUnit_Extensions_Database_DataSet_XMLDataSet(
+      $this->createXMLDataSet(
         dirname(__FILE__) . '/dataset/group_nesting.xml'
       )
     );
index 292995e0749bafa57207cf3745ac18e704770dbf..47f038e90de410d737f564e79cf0aca06ad62118 100644 (file)
@@ -133,13 +133,13 @@ class api_v3_MailingContactTest extends CiviUnitTestCase {
         $op = new PHPUnit_Extensions_Database_Operation_Insert();
         //Create the User
         $op->execute($this->_dbconn,
-          new PHPUnit_Extensions_Database_DataSet_XMLDataSet(
+          $this->createXMLDataSet(
             dirname(__FILE__) . '/dataset/mailing_contact.xml'
           )
         );
         //~ Create the Mailing and connections to the user
         $op->execute($this->_dbconn,
-          new PHPUnit_Extensions_Database_DataSet_XMLDataSet(
+          $this->createXMLDataSet(
             dirname(__FILE__) . '/dataset/mailing_delivered.xml'
           )
         );
@@ -168,13 +168,13 @@ class api_v3_MailingContactTest extends CiviUnitTestCase {
         $op = new PHPUnit_Extensions_Database_Operation_Insert();
         //Create the User
         $op->execute($this->_dbconn,
-          new PHPUnit_Extensions_Database_DataSet_XMLDataSet(
+          $this->createXMLDataSet(
             dirname(__FILE__) . '/dataset/mailing_contact.xml'
           )
         );
         //~ Create the Mailing and connections to the user
         $op->execute($this->_dbconn,
-          new PHPUnit_Extensions_Database_DataSet_XMLDataSet(
+          $this->createXMLDataSet(
             dirname(__FILE__) . '/dataset/mailing_bounced.xml'
           )
         );
index 1a1e6ecb1854ffcd8b980d76a3ecc56083e11cc2..b73cbc570cde1d96b9f2d8b4e75f4406aa37e999 100644 (file)
@@ -758,7 +758,7 @@ class api_v3_ProfileTest extends CiviUnitTestCase {
     // @TODO: Create profile with custom fields
     $op = new PHPUnit_Extensions_Database_Operation_Insert();
     $op->execute($this->_dbconn,
-      new PHPUnit_Extensions_Database_DataSet_FlatXMLDataSet(
+      $this->createFlatXMLDataSet(
         dirname(__FILE__) . '/dataset/uf_group_contact_activity_26.xml'
       )
     );
index 60d37a7146af5e9fe4008f692f1719abc18ad60a..b09f62da25b4a2038851bd583132e1a9d9aabb9b 100644 (file)
@@ -60,7 +60,7 @@ class api_v3_UFFieldTest extends CiviUnitTestCase {
     $op = new PHPUnit_Extensions_Database_Operation_Insert;
     $op->execute(
       $this->_dbconn,
-      new PHPUnit_Extensions_Database_DataSet_FlatXMLDataSet(dirname(__FILE__) . '/dataset/uf_group_test.xml')
+      $this->createFlatXMLDataSet(dirname(__FILE__) . '/dataset/uf_group_test.xml')
     );
 
     $this->callAPISuccess('uf_field', 'getfields', array('cache_clear' => 1));
index 0efbd0407af9f4205cf6d524b6bb687d5d682b6f..164827e0676f208622ec8002cd6d5f6d7336f050 100644 (file)
@@ -59,7 +59,7 @@ class api_v3_UFJoinTest extends CiviUnitTestCase {
     $op = new PHPUnit_Extensions_Database_Operation_Insert;
     $op->execute(
       $this->_dbconn,
-      new PHPUnit_Extensions_Database_DataSet_FlatXMLDataSet(dirname(__FILE__) . '/dataset/uf_group_test.xml')
+      $this->createFlatXMLDataSet(dirname(__FILE__) . '/dataset/uf_group_test.xml')
     );
   }
 
index 6f2f86985e7267536941a09fdbd24445204d560e..3849d0f85c2e046ef40b610a169e48fb8fe27949 100644 (file)
@@ -62,7 +62,7 @@ class api_v3_UFMatchTest extends CiviUnitTestCase {
     $op = new PHPUnit_Extensions_Database_Operation_Insert;
     $op->execute(
       $this->_dbconn,
-      new PHPUnit_Extensions_Database_DataSet_FlatXMLDataSet(dirname(__FILE__) . '/dataset/uf_group_test.xml')
+      $this->createFlatXMLDataSet(dirname(__FILE__) . '/dataset/uf_group_test.xml')
     );
 
     $this->_params = array(