Merge pull request #11407 from cividesk/CRM-21553
[civicrm-core.git] / tests / phpunit / CRM / Utils / DeprecatedUtilsTest.php
index f1d5e348cdea7451f3b161151d96c196b0bf9eee..9c7277504c360aa2896c7b3c3ac5f1998cf26745 100644 (file)
@@ -1,10 +1,10 @@
 <?php
 
-require_once 'CiviTest/CiviUnitTestCase.php';
 require_once 'CRM/Utils/DeprecatedUtils.php';
 
 /**
  * Class CRM_Utils_DeprecatedUtilsTest
+ * @group headless
  */
 class CRM_Utils_DeprecatedUtilsTest extends CiviUnitTestCase {
 
@@ -30,41 +30,9 @@ class CRM_Utils_DeprecatedUtilsTest extends CiviUnitTestCase {
   public function testCheckParamsWithNoContactType() {
     $params = array('foo' => 'bar');
     $contact = _civicrm_api3_deprecated_contact_check_params($params, FALSE);
-    $this->assertEquals(1, $contact['is_error'], "In line " . __LINE__);
-  }
-
-
-  /**
-   *  Test civicrm_contact_check_params with a duplicate.
-   */
-  public function testCheckParamsWithDuplicateContact() {
-    //  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'
-      )
-    );
-
-    $params = array(
-      '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",
-      CRM_Utils_Array::value('error_message', $contact)
-    );
   }
 
-
   /**
    *  Test civicrm_contact_check_params with a duplicate.
    *  and request the error in array format
@@ -89,7 +57,7 @@ class CRM_Utils_DeprecatedUtilsTest extends CiviUnitTestCase {
       'email' => 'TestContact@example.com',
       'contact_type' => 'Individual',
     );
-    $contact = _civicrm_api3_deprecated_contact_check_params($params, TRUE, TRUE);
+    $contact = _civicrm_api3_deprecated_contact_check_params($params, TRUE);
     $this->assertEquals(1, $contact['is_error']);
     $this->assertRegexp("/matching contacts.*17/s",
       $contact['error_message']['message']
@@ -103,7 +71,7 @@ class CRM_Utils_DeprecatedUtilsTest extends CiviUnitTestCase {
   public function testCheckParamsWithNoParams() {
     $params = array();
     $contact = _civicrm_api3_deprecated_contact_check_params($params, FALSE);
-    $this->assertEquals(1, $contact['is_error'], "In line " . __LINE__);
+    $this->assertEquals(1, $contact['is_error']);
   }
 
 }