Merge pull request #20947 from colemanw/sqlFunctions
[civicrm-core.git] / tests / phpunit / CRM / Contact / SelectorTest.php
index 699a7b030187d4ccc17e065bec45875b34d5c7b9..2841d6f1f4510b33284b2e53c3d4abecae039606 100644 (file)
@@ -66,7 +66,7 @@ class CRM_Contact_SelectorTest extends CiviUnitTestCase {
       $this->assertLike($this->strWrangle($queryString), $this->strWrangle($sql[$index]));
     }
     if (!empty($dataSet['where_contains'])) {
-      $this->assertContains($this->strWrangle(str_replace('@tagid', $tag['id'], $dataSet['where_contains'])), $this->strWrangle($sql[2]));
+      $this->assertStringContainsString($this->strWrangle(str_replace('@tagid', $tag['id'], $dataSet['where_contains'])), $this->strWrangle($sql[2]));
     }
     // Ensure that search builder return individual contact as per criteria
     if ($dataSet['context'] === 'builder') {
@@ -175,7 +175,7 @@ class CRM_Contact_SelectorTest extends CiviUnitTestCase {
     //Check if email column contains (On Hold) string.
     foreach ($rows[$contactID] as $key => $value) {
       if (strpos($key, 'email') !== FALSE) {
-        $this->assertContains("(On Hold)", (string) $value);
+        $this->assertStringContainsString("(On Hold)", (string) $value);
       }
     }
   }
@@ -664,7 +664,7 @@ AND ( 1 ) AND (contact_a.is_deleted = 0)',
       FALSE, FALSE
     );
     //Check if custom table is included in $query->_tables.
-    $this->assertTrue(in_array($cgTableName, array_keys($query->_tables)));
+    $this->assertTrue(array_key_exists($cgTableName, $query->_tables));
     //Assert if from clause joins the custom table.
     $this->assertTrue(strpos($query->_fromClause, $cgTableName) !== FALSE);
     $this->callAPISuccess('CustomField', 'delete', ['id' => $customField['id']]);