From 79e676871a421270f3c3122619efe41a62c12750 Mon Sep 17 00:00:00 2001 From: Seamus Lee Date: Mon, 6 Jun 2016 10:26:30 +1000 Subject: [PATCH] Fix syntax and tests --- CRM/Core/BAO/SchemaHandler.php | 2 +- tests/phpunit/CRM/Core/BAO/SchemaHandlerTest.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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; } -- 2.25.1