From ae2103eaab47e7f14b2e26ea2a287899c5d1a89b Mon Sep 17 00:00:00 2001 From: eileen Date: Mon, 20 May 2019 15:48:07 +1200 Subject: [PATCH] More dbunit removal --- .../phpunit/CRM/Utils/DeprecatedUtilsTest.php | 19 +++---------- .../api/v3/dataset/email_contact_17.xml | 28 ------------------- 2 files changed, 4 insertions(+), 43 deletions(-) delete mode 100644 tests/phpunit/api/v3/dataset/email_contact_17.xml diff --git a/tests/phpunit/CRM/Utils/DeprecatedUtilsTest.php b/tests/phpunit/CRM/Utils/DeprecatedUtilsTest.php index 9c7277504c..e202473a21 100644 --- a/tests/phpunit/CRM/Utils/DeprecatedUtilsTest.php +++ b/tests/phpunit/CRM/Utils/DeprecatedUtilsTest.php @@ -38,28 +38,17 @@ class CRM_Utils_DeprecatedUtilsTest extends CiviUnitTestCase { * and request the error in array format */ public function testCheckParamsWithDuplicateContact2() { - // Insert a row in civicrm_contact creating individual contact - $op = new PHPUnit_Extensions_Database_Operation_Insert(); - $op->execute($this->_dbconn, - $this->createXMLDataSet( - dirname(__FILE__) . '/../../api/v3/dataset/contact_17.xml' - ) - ); - $op->execute($this->_dbconn, - $this->createXMLDataSet( - dirname(__FILE__) . '/../../api/v3/dataset/email_contact_17.xml' - ) - ); + $this->individualCreate(['first_name' => 'Test', 'last_name' => 'Contact', 'email' => 'TestContact@example.com']); - $params = array( + $params = [ 'first_name' => 'Test', 'last_name' => 'Contact', 'email' => 'TestContact@example.com', 'contact_type' => 'Individual', - ); + ]; $contact = _civicrm_api3_deprecated_contact_check_params($params, TRUE); $this->assertEquals(1, $contact['is_error']); - $this->assertRegexp("/matching contacts.*17/s", + $this->assertRegexp("/matching contacts.*1/s", $contact['error_message']['message'] ); } diff --git a/tests/phpunit/api/v3/dataset/email_contact_17.xml b/tests/phpunit/api/v3/dataset/email_contact_17.xml deleted file mode 100644 index 4239ae0f6f..0000000000 --- a/tests/phpunit/api/v3/dataset/email_contact_17.xml +++ /dev/null @@ -1,28 +0,0 @@ - - - - - id - contact_id - location_type_id - email - is_primary - is_billing - on_hold - is_bulkmail - hold_date - reset_date - - 100 - 17 - 1 - TestContact@example.com - 1 - 1 - 0 - 0 - - - -
-
-- 2.25.1