From: Seamus Lee Date: Mon, 6 Jun 2016 00:26:30 +0000 (+1000) Subject: Fix syntax and tests X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=79e676871a421270f3c3122619efe41a62c12750;p=civicrm-core.git Fix syntax and tests --- diff --git a/CRM/Core/BAO/SchemaHandler.php b/CRM/Core/BAO/SchemaHandler.php index 3ec0fad1ee..a390e7de3d 100644 --- a/CRM/Core/BAO/SchemaHandler.php +++ b/CRM/Core/BAO/SchemaHandler.php @@ -589,7 +589,7 @@ MODIFY {$columnName} varchar( $length ) */ public static function checkIfFieldExists($tableName, $columnName) { $result = CRM_Core_DAO::executeQuery( - "SHOW COLUMNS FROM $tableName LIKE ' %1 '", + "SHOW COLUMNS FROM $tableName LIKE %1", array(1 => array($columnName, 'String')) ); if ($result->fetch()) { diff --git a/tests/phpunit/CRM/Core/BAO/SchemaHandlerTest.php b/tests/phpunit/CRM/Core/BAO/SchemaHandlerTest.php index 57f1d763bc..00a86bbc2d 100644 --- a/tests/phpunit/CRM/Core/BAO/SchemaHandlerTest.php +++ b/tests/phpunit/CRM/Core/BAO/SchemaHandlerTest.php @@ -128,7 +128,7 @@ class CRM_Core_BAO_SchemaHandlerTest extends CiviUnitTestCase { public function columnTests() { $columns = array(); $columns[] = array('civicrm_contribution', 'total_amount'); - $columns[] = array('civicrm_contact', 'from_name'); + $columns[] = array('civicrm_contact', 'first_name'); $columns[] = array('civicrm_contact', 'xxxx'); return $columns; }