From eaf81f0036267c84043057bf6ca73300cf68b669 Mon Sep 17 00:00:00 2001 From: Jitendra Purohit Date: Tue, 27 Jun 2017 09:54:15 +0530 Subject: [PATCH] existing test fixes --- CRM/Utils/Check/Component/Schema.php | 2 +- tests/phpunit/CRM/Core/BAO/SchemaHandlerTest.php | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/CRM/Utils/Check/Component/Schema.php b/CRM/Utils/Check/Component/Schema.php index caf8558f22..d281c26a40 100644 --- a/CRM/Utils/Check/Component/Schema.php +++ b/CRM/Utils/Check/Component/Schema.php @@ -54,7 +54,7 @@ class CRM_Utils_Check_Component_Schema extends CRM_Utils_Check_Component { } if ($missingIndices || $existingKeyIndices) { $message = "You have missing indices on some tables. This may cause poor performance."; - if ($keyMessage) { + if (!empty($keyMessage)) { $message = $keyMessage; } $msg = new CRM_Utils_Check_Message( diff --git a/tests/phpunit/CRM/Core/BAO/SchemaHandlerTest.php b/tests/phpunit/CRM/Core/BAO/SchemaHandlerTest.php index e2bcba6882..2571ca3cf4 100644 --- a/tests/phpunit/CRM/Core/BAO/SchemaHandlerTest.php +++ b/tests/phpunit/CRM/Core/BAO/SchemaHandlerTest.php @@ -184,7 +184,7 @@ class CRM_Core_BAO_SchemaHandlerTest extends CiviUnitTestCase { * Check there are no missing indices */ public function testGetMissingIndices() { - $missingIndices = CRM_Core_BAO_SchemaHandler::getMissingIndices(); + list($missingIndices) = CRM_Core_BAO_SchemaHandler::getMissingIndices(); $this->assertTrue(empty($missingIndices)); } @@ -230,7 +230,7 @@ class CRM_Core_BAO_SchemaHandlerTest extends CiviUnitTestCase { */ public function testReconcileMissingIndices() { CRM_Core_DAO::executeQuery('ALTER TABLE civicrm_contact DROP INDEX index_sort_name'); - $missingIndices = CRM_Core_BAO_SchemaHandler::getMissingIndices(); + list($missingIndices) = CRM_Core_BAO_SchemaHandler::getMissingIndices(); $this->assertEquals(array( 'civicrm_contact' => array( array( @@ -242,7 +242,7 @@ class CRM_Core_BAO_SchemaHandlerTest extends CiviUnitTestCase { ), ), $missingIndices); $this->callAPISuccess('System', 'updateindexes', array()); - $missingIndices = CRM_Core_BAO_SchemaHandler::getMissingIndices(); + list($missingIndices) = CRM_Core_BAO_SchemaHandler::getMissingIndices(); $this->assertTrue(empty($missingIndices)); } -- 2.25.1