From bbfd46a57a739b0b9eb3d2966169f69dc0935e2b Mon Sep 17 00:00:00 2001 From: Tim Otten Date: Tue, 22 Jul 2014 00:35:55 -0700 Subject: [PATCH] CRM-15011 - tests - Fix dbunit references --- .../phpunit/CRM/Activity/BAO/ActivityTest.php | 16 ++++++------ tests/phpunit/CRM/Contact/BAO/QueryTest.php | 2 +- .../Contact/Form/Search/Custom/GroupTest.php | 6 ++--- tests/phpunit/CRM/Core/BAO/IMTest.php | 2 +- tests/phpunit/CRM/Mailing/BAO/QueryTest.php | 2 +- .../CRM/Member/Form/MembershipTest.php | 2 +- .../phpunit/CRM/Utils/DeprecatedUtilsTest.php | 8 +++--- tests/phpunit/CiviTest/CiviUnitTestCase.php | 2 +- tests/phpunit/api/v3/ContactTest.php | 26 +++++++++---------- tests/phpunit/api/v3/GroupNestingTest.php | 6 ++--- tests/phpunit/api/v3/MailingContactTest.php | 8 +++--- tests/phpunit/api/v3/ProfileTest.php | 2 +- tests/phpunit/api/v3/UFFieldTest.php | 2 +- tests/phpunit/api/v3/UFJoinTest.php | 2 +- tests/phpunit/api/v3/UFMatchTest.php | 2 +- 15 files changed, 44 insertions(+), 44 deletions(-) diff --git a/tests/phpunit/CRM/Activity/BAO/ActivityTest.php b/tests/phpunit/CRM/Activity/BAO/ActivityTest.php index 41c767ff13..98886b59e1 100644 --- a/tests/phpunit/CRM/Activity/BAO/ActivityTest.php +++ b/tests/phpunit/CRM/Activity/BAO/ActivityTest.php @@ -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' ) ); diff --git a/tests/phpunit/CRM/Contact/BAO/QueryTest.php b/tests/phpunit/CRM/Contact/BAO/QueryTest.php index 5899e68a3d..03e32efc07 100644 --- a/tests/phpunit/CRM/Contact/BAO/QueryTest.php +++ b/tests/phpunit/CRM/Contact/BAO/QueryTest.php @@ -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' ) ); diff --git a/tests/phpunit/CRM/Contact/Form/Search/Custom/GroupTest.php b/tests/phpunit/CRM/Contact/Form/Search/Custom/GroupTest.php index 1af3b27206..0bf7faa9cf 100644 --- a/tests/phpunit/CRM/Contact/Form/Search/Custom/GroupTest.php +++ b/tests/phpunit/CRM/Contact/Form/Search/Custom/GroupTest.php @@ -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' ) ); diff --git a/tests/phpunit/CRM/Core/BAO/IMTest.php b/tests/phpunit/CRM/Core/BAO/IMTest.php index f3a45feb5d..22735a36d8 100644 --- a/tests/phpunit/CRM/Core/BAO/IMTest.php +++ b/tests/phpunit/CRM/Core/BAO/IMTest.php @@ -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; diff --git a/tests/phpunit/CRM/Mailing/BAO/QueryTest.php b/tests/phpunit/CRM/Mailing/BAO/QueryTest.php index 72b38be28e..6a4c24bbaf 100644 --- a/tests/phpunit/CRM/Mailing/BAO/QueryTest.php +++ b/tests/phpunit/CRM/Mailing/BAO/QueryTest.php @@ -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' ) ); diff --git a/tests/phpunit/CRM/Member/Form/MembershipTest.php b/tests/phpunit/CRM/Member/Form/MembershipTest.php index 0c59467321..d6db032709 100644 --- a/tests/phpunit/CRM/Member/Form/MembershipTest.php +++ b/tests/phpunit/CRM/Member/Form/MembershipTest.php @@ -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' ) ); diff --git a/tests/phpunit/CRM/Utils/DeprecatedUtilsTest.php b/tests/phpunit/CRM/Utils/DeprecatedUtilsTest.php index 6405ce5cea..b9f2236a2a 100644 --- a/tests/phpunit/CRM/Utils/DeprecatedUtilsTest.php +++ b/tests/phpunit/CRM/Utils/DeprecatedUtilsTest.php @@ -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' ) ); diff --git a/tests/phpunit/CiviTest/CiviUnitTestCase.php b/tests/phpunit/CiviTest/CiviUnitTestCase.php index 6e2ce21d96..d4a75d8ec4 100644 --- a/tests/phpunit/CiviTest/CiviUnitTestCase.php +++ b/tests/phpunit/CiviTest/CiviUnitTestCase.php @@ -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); } diff --git a/tests/phpunit/api/v3/ContactTest.php b/tests/phpunit/api/v3/ContactTest.php index bdf8f60d9a..ff46898e40 100644 --- a/tests/phpunit/api/v3/ContactTest.php +++ b/tests/phpunit/api/v3/ContactTest.php @@ -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' ) ); diff --git a/tests/phpunit/api/v3/GroupNestingTest.php b/tests/phpunit/api/v3/GroupNestingTest.php index cc43ccaa17..0597397e50 100644 --- a/tests/phpunit/api/v3/GroupNestingTest.php +++ b/tests/phpunit/api/v3/GroupNestingTest.php @@ -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' ) ); diff --git a/tests/phpunit/api/v3/MailingContactTest.php b/tests/phpunit/api/v3/MailingContactTest.php index 292995e074..47f038e90d 100644 --- a/tests/phpunit/api/v3/MailingContactTest.php +++ b/tests/phpunit/api/v3/MailingContactTest.php @@ -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' ) ); diff --git a/tests/phpunit/api/v3/ProfileTest.php b/tests/phpunit/api/v3/ProfileTest.php index 1a1e6ecb18..b73cbc570c 100644 --- a/tests/phpunit/api/v3/ProfileTest.php +++ b/tests/phpunit/api/v3/ProfileTest.php @@ -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' ) ); diff --git a/tests/phpunit/api/v3/UFFieldTest.php b/tests/phpunit/api/v3/UFFieldTest.php index 60d37a7146..b09f62da25 100644 --- a/tests/phpunit/api/v3/UFFieldTest.php +++ b/tests/phpunit/api/v3/UFFieldTest.php @@ -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)); diff --git a/tests/phpunit/api/v3/UFJoinTest.php b/tests/phpunit/api/v3/UFJoinTest.php index 0efbd0407a..164827e067 100644 --- a/tests/phpunit/api/v3/UFJoinTest.php +++ b/tests/phpunit/api/v3/UFJoinTest.php @@ -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') ); } diff --git a/tests/phpunit/api/v3/UFMatchTest.php b/tests/phpunit/api/v3/UFMatchTest.php index 6f2f86985e..3849d0f85c 100644 --- a/tests/phpunit/api/v3/UFMatchTest.php +++ b/tests/phpunit/api/v3/UFMatchTest.php @@ -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( -- 2.25.1