From: Jitendra Purohit Date: Tue, 27 Jun 2017 04:24:15 +0000 (+0530) Subject: existing test fixes X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=eaf81f0036267c84043057bf6ca73300cf68b669;p=civicrm-core.git existing test fixes --- 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)); }