Merge pull request #17253 from mattwire/utf8convertblocksize
[civicrm-core.git] / tests / phpunit / CRM / Core / BAO / IMTest.php
index c5700282ae1fbebce64b703ea352b46ad81a466b..cc82bd0eb02f151a36e5a74ecfba18726305f43c 100644 (file)
@@ -16,14 +16,14 @@ class CRM_Core_BAO_IMTest extends CiviUnitTestCase {
   public function testAdd() {
     $contactId = $this->individualCreate();
 
-    $params = array();
-    $params = array(
+    $params = [];
+    $params = [
       'name' => 'jane.doe',
       'provider_id' => 1,
       'is_primary' => 1,
       'location_type_id' => 1,
       'contact_id' => $contactId,
-    );
+    ];
 
     CRM_Core_BAO_IM::add($params);
 
@@ -33,13 +33,13 @@ class CRM_Core_BAO_IMTest extends CiviUnitTestCase {
 
     // Now call add() to modify an existing IM
 
-    $params = array();
-    $params = array(
+    $params = [];
+    $params = [
       'id' => $imId,
       'contact_id' => $contactId,
       'provider_id' => 3,
       'name' => 'doe.jane',
-    );
+    ];
 
     CRM_Core_BAO_IM::add($params);
 
@@ -55,11 +55,7 @@ class CRM_Core_BAO_IMTest extends CiviUnitTestCase {
    * AllIMs() method - get all IMs for our contact, with primary IM first
    */
   public function testAllIMs() {
-    $op = new PHPUnit_Extensions_Database_Operation_Insert();
-    $op->execute(
-      $this->_dbconn,
-      $this->createFlatXMLDataSet(dirname(__FILE__) . '/dataset/im_test.xml')
-    );
+    $this->loadXMLDataSet(dirname(__FILE__) . '/dataset/im_test.xml');
 
     $contactId = 69;
     $IMs = CRM_Core_BAO_IM::allIMs($contactId);