INFRA-132 - tests/ - PHPStorm cleanup
[civicrm-core.git] / tests / phpunit / CRM / Contact / BAO / QueryTest.php
index e4fb4130fe3222d582a18c370de8a518374f8232..0e240b35002cd18cc13836d066c58e4ab51cf282 100644 (file)
@@ -43,13 +43,13 @@ class CRM_Contact_BAO_QueryTest extends CiviUnitTestCase {
     );
 
     $params = CRM_Contact_BAO_Query::convertFormValues($fv);
-    $obj    = new CRM_Contact_BAO_Query($params);
+    $obj = new CRM_Contact_BAO_Query($params);
 
     // let's set useGroupBy=true since we are listing contacts here who might belong to
     // more than one group / tag / notes etc.
     $obj->_useGroupBy = TRUE;
 
-    $dao    = $obj->searchQuery();
+    $dao = $obj->searchQuery();
 
     $contacts = array();
     while ($dao->fetch()) {
@@ -68,7 +68,11 @@ class CRM_Contact_BAO_QueryTest extends CiviUnitTestCase {
   public function testSearchProfileHomeCityCRM14263() {
     $contactID = $this->individualCreate();
     CRM_Core_Config::singleton()->defaultSearchProfileID = 1;
-    $this->callAPISuccess('address', 'create', array('contact_id' => $contactID, 'city' => 'Cool City', 'location_type_id' => 1));
+    $this->callAPISuccess('address', 'create', array(
+        'contact_id' => $contactID,
+        'city' => 'Cool City',
+        'location_type_id' => 1
+      ));
     $params = array(
       0 => array(
         0 => 'city-1',
@@ -106,7 +110,11 @@ class CRM_Contact_BAO_QueryTest extends CiviUnitTestCase {
   public function testSearchProfileHomeCityNoResultsCRM14263() {
     $contactID = $this->individualCreate();
     CRM_Core_Config::singleton()->defaultSearchProfileID = 1;
-    $this->callAPISuccess('address', 'create', array('contact_id' => $contactID, 'city' => 'Cool City', 'location_type_id' => 1));
+    $this->callAPISuccess('address', 'create', array(
+        'contact_id' => $contactID,
+        'city' => 'Cool City',
+        'location_type_id' => 1
+      ));
     $params = array(
       0 => array(
         0 => 'city-1',
@@ -136,6 +144,7 @@ class CRM_Contact_BAO_QueryTest extends CiviUnitTestCase {
 
     }
   }
+
   /**
    * CRM-14263 search builder failure with search profile & address in criteria
    * We are retrieving primary here - checking the actual sql seems super prescriptive - but since the massive query object has
@@ -144,28 +153,32 @@ class CRM_Contact_BAO_QueryTest extends CiviUnitTestCase {
   public function testSearchProfilePrimaryCityCRM14263() {
     $contactID = $this->individualCreate();
     CRM_Core_Config::singleton()->defaultSearchProfileID = 1;
-    $this->callAPISuccess('address', 'create', array('contact_id' => $contactID, 'city' => 'Cool City', 'location_type_id' => 1));
+    $this->callAPISuccess('address', 'create', array(
+        'contact_id' => $contactID,
+        'city' => 'Cool City',
+        'location_type_id' => 1
+      ));
     $params = array(
-        0 => array(
-          0 => 'city',
-          1 => '=',
-          2 => 'Cool City',
-          3 => 1,
-          4 => 0,
-        ),
-      );
+      0 => array(
+        0 => 'city',
+        1 => '=',
+        2 => 'Cool City',
+        3 => 1,
+        4 => 0,
+      ),
+    );
     $returnProperties = array(
-        'contact_type' => 1,
-        'contact_sub_type' => 1,
-        'sort_name' => 1,
-      );
+      'contact_type' => 1,
+      'contact_sub_type' => 1,
+      'sort_name' => 1,
+    );
     $expectedSQL = "SELECT contact_a.id as contact_id, contact_a.contact_type  as `contact_type`, contact_a.contact_sub_type  as `contact_sub_type`, contact_a.sort_name  as `sort_name`, civicrm_address.id as address_id, civicrm_address.city as `city`  FROM civicrm_contact contact_a LEFT JOIN civicrm_address ON ( contact_a.id = civicrm_address.contact_id AND civicrm_address.is_primary = 1 ) WHERE  (  ( LOWER(civicrm_address.city) = 'cool city' )  )  AND (contact_a.is_deleted = 0)    ORDER BY contact_a.sort_name asc, contact_a.id ";
     $queryObj = new CRM_Contact_BAO_Query($params, $returnProperties);
     try {
       $this->assertEquals($expectedSQL, $queryObj->searchQuery(0, 0, NULL,
-          FALSE, FALSE,
-          FALSE, FALSE,
-          TRUE));
+        FALSE, FALSE,
+        FALSE, FALSE,
+        TRUE));
     }
     catch (PEAR_Exception $e) {
       $err = $e->getCause();