From 36575b0997349e22fc7c050695e36f2152f9fd4a Mon Sep 17 00:00:00 2001 From: eileenmcnaugton Date: Sat, 22 Aug 2015 20:33:55 +1200 Subject: [PATCH] phpcs fixes --- api/v3/Contact.php | 4 ++-- tests/phpunit/api/v3/ContactTest.php | 32 ++++++++++++++++++---------- 2 files changed, 23 insertions(+), 13 deletions(-) diff --git a/api/v3/Contact.php b/api/v3/Contact.php index aa9ce567c8..9e9f754cd9 100644 --- a/api/v3/Contact.php +++ b/api/v3/Contact.php @@ -853,7 +853,7 @@ function civicrm_api3_contact_getquick($params) { if (!in_array('email', $list)) { $includeEmailFrom = "LEFT JOIN civicrm_email eml ON ( cc.id = eml.contact_id AND eml.is_primary = 1 )"; } - $emailWhere = " WHERE email LIKE '$strSearch'"; + $emailWhere = " WHERE email LIKE '$strSearch'"; } } @@ -912,7 +912,7 @@ function civicrm_api3_contact_getquick($params) { ) "; } - $query .=") t + $query .= ") t {$orderByOuter} LIMIT 0, {$limit} "; diff --git a/tests/phpunit/api/v3/ContactTest.php b/tests/phpunit/api/v3/ContactTest.php index cef189c5ff..a892a89561 100644 --- a/tests/phpunit/api/v3/ContactTest.php +++ b/tests/phpunit/api/v3/ContactTest.php @@ -2267,7 +2267,7 @@ class api_v3_ContactTest extends CiviUnitTestCase { $expected = array( 'Bob, Bob', 'A Bobby, Bobby', - 'B Bobby, Bobby' + 'B Bobby, Bobby', ); foreach ($expected as $index => $value) { @@ -2305,16 +2305,26 @@ class api_v3_ContactTest extends CiviUnitTestCase { $contacts = array( array('first_name' => 'Bob', 'last_name' => 'Bob', 'external_identifier' => 'abc', 'email' => 'bob@bob.com'), array('first_name' => 'Bobby', 'last_name' => 'A Bobby', 'external_identifier' => 'abcd'), - array('first_name' => 'Bobby', 'last_name' => 'B Bobby', 'external_identifier' => 'bcd', 'api.address.create' => array( - 'street_address' => 'Sesame Street', - 'city' => 'Toronto', - 'location_type_id' => 1, - ),), - array('first_name' => 'Bobby', 'last_name' => 'C Bobby', 'external_identifier' => 'bcde', 'api.address.create' => array( - 'street_address' => 'Te huarahi', - 'city' => 'Whanganui', - 'location_type_id' => 1, - ),), + array( + 'first_name' => 'Bobby', + 'last_name' => 'B Bobby', + 'external_identifier' => 'bcd', + 'api.address.create' => array( + 'street_address' => 'Sesame Street', + 'city' => 'Toronto', + 'location_type_id' => 1, + ), + ), + array( + 'first_name' => 'Bobby', + 'last_name' => 'C Bobby', + 'external_identifier' => 'bcde', + 'api.address.create' => array( + 'street_address' => 'Te huarahi', + 'city' => 'Whanganui', + 'location_type_id' => 1, + ), + ), array('first_name' => 'Bobby', 'last_name' => 'D Bobby', 'external_identifier' => 'efg'), array('first_name' => 'Bobby', 'last_name' => 'E Bobby', 'external_identifier' => 'hij', 'email' => 'bob@bobby.com'), array('first_name' => 'Bobby', 'last_name' => 'F Bobby', 'external_identifier' => 'klm'), -- 2.25.1